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.
Asked
Active
Viewed 9,405 times
3

Amorphous
- 675
- 1
- 8
- 26
4 Answers
16
I got it to work by removing PyQT5 from
Settings > Project > Project Interpreter
and reinstalling it within PyCharm.
Restart PyCharm afterwards.
-
Does this install it with pip or conda? I prefer to let conda manage stuff where possible. – flutefreak7 Mar 20 '18 at 15:51
-
It didn't work for me, I got same issue with PySIde2 – Lalitkumar Tarsariya Jul 19 '18 at 12:03
-
1Thanks. After installing PyQt5 via PyCharm, it mumbled "updating skeletons for '.virtualenvs/...", and afterwords I had to restart PyCharm. Then it worked. I'll add that in the answer, as it possibly helps, and doesn't do harm ;-) – nerdoc Sep 15 '18 at 06:35
-
The first working solution after several hours of searching. Thank you very much. – Atalanttore Feb 02 '20 at 20:27
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