pydantic-pycharm-plugin: Autoimport breaks when enabling the plugin
Describe the bug
Having the pydantic-pycharm-plugin enabled breaks autoimports.
To Reproduce Steps to reproduce the behavior:
- Install the pydantic plugin and enable it
- Create a simple file
main.pywith the content:
from typing import Optional
from pydantic import BaseModel
class Item(BaseModel):
name: str
description: Optional[str] = Field()
price: float
tax: Optional[float] = None
- Navigate the caret between
Fieldand(). ctrl+space+spaceoralt+enter- No pydantic import suggested


- Disable pydantic plugin
- Try the same:


Expected behavior Autoimports should work.
Environments (please complete the following information):
- IDE: PyCharm Professional
2021.1(Edit: Tested in201.1.1as well. Same issue) - OS: Red Hat Enterprise Linux release 8.3 (Ootpa)
- Pydantic Versio:
1.8.1 - Plugin version:
0.3.0
Additional context I’ve tried recreating the environment, clearing and invalidating cache.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 21 (8 by maintainers)
I’ll check out both pipx and your poetry plugin, thank you!!
I listened to episode 313 of talkpython.fm. Creator of pydantic gave you some nice words and in the end of the episode he encourages not only sponsoring the huge packages, but also those who make those packages awesome. This is one of them. 😊 So my pleasure.
Tried on Ubuntu 20.04.2 with Pycharm: 2021.1
Same to you 😸
No, this time it was a personal project.
I’ll try a fresh project with nothing but pydantic installed tomorrow - with and without a virtual environment.
I don’t think so, I’ll confirm tomorrow.
I’m using bundled Java. They are on Windows and on Mac, using same version of the plugin and Pycharm. So, it seems to work for everyone but me.
Don’t know what more information I could add about my environment except that I’m using Wayland and Swaywm. Installed using toolbox.
I could try to do a manual install of the 2020.x version?
Sorry, never got the chance to do this. I’ll try tomorrow.
I will test first thing tomorrow morning. I’m unfortunately out for the day.
Thank you for the quick follow up!
I talked to multiple in the FastAPI discord who said it worked perfectly fine for them as well, so I’m not sure what to do.
I tried disabling all plugins except this one, in case there was some interfering plugins causing the issue, but same issue.
Let me know if there is some logs or something I can test for you.