3

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

Amorphous
  • 675
  • 1
  • 8
  • 26

4 Answers4

16

I got it to work by removing PyQT5 from

Settings > Project > Project Interpreter

and reinstalling it within PyCharm.

Restart PyCharm afterwards.

jps
  • 20,041
  • 15
  • 75
  • 79
Amorphous
  • 675
  • 1
  • 8
  • 26
9

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

Sufiyan Ghori
  • 18,164
  • 14
  • 82
  • 110
Ed Chow
  • 313
  • 1
  • 3
  • 14
  • This actually worked pretty good. Under windows PyCharm now resolves the stubbed \_\_init\_\_.py's in `%HOMEDRIVE%%HOMEPATH%\.PyCharmxxxx.x\system\python_stubs\xxxxx\PySide2\..` – Erik Wolf Nov 14 '18 at 09:38
-1

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.

Pavel Kaigorodov
  • 322
  • 1
  • 2
  • 11
-1

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

Sumeet
  • 119
  • 1
  • 7