3
votes

I'm trying to learn how to use PyQT5. I created a new folder under my user profile and spun up a virtualenv (and installed PyQT5 from pip3) in a folder called env. I created the project in another folder called guis and pointed PyCharm to the env environment. Pycharm can't find the submodules but sees PyQT5.QtWidgets just fine.

Screnshot: enter image description here

4

4 Answers

16
votes

I got it to work by removing PyQT5 from

Settings > Project > Project Interpreter

and reinstalling it within PyCharm.

Restart PyCharm afterwards.

9
votes

I had to go to File --> Invalidate Caches / Restart as well

-1
votes

In my case i had non-latin symbols in path to python (in AppData). I made new windows user with only-latin name, using it instead of original user fixed the problem.

-1
votes

setting -> project interpreter -> click setting icon -> add -> new environment -> ( add path) -> check 'inherit global site-packages' and 'make available to all projects' -> click OK

always use same environment or you can use different environment for different projects, just check global packages