1

I pip installed PyQt5, and verified this in my CMD with pip show PyQt5 which gave me:

C:\Users\92175>pip show PyQt5
Name: PyQt5
Version: 5.15.0
Summary: Python bindings for the Qt cross platform application toolkit
Home-page: https://www.riverbankcomputing.com/software/pyqt/
Author: Riverbank Computing Limited
Author-email: info@riverbankcomputing.com
License: GPL v3
Location: c:\python\python37-32\lib\site-packages
Requires: PyQt5-sip
Required-by:

When I run my code in PyCharm, from PyQt5 import QtWidgets, QtCore, QtGui... I get the error ModuleNotFoundError: No module named 'PyQt5'

I saw the same question in another place: ImportError: No module named PytQt5 however this is a little different since I'm neither using Ubuntu nor bash.

Do I need to bother my IT guy and ask him to help me modify PYTHONPATH? (I think admin rights are required for this). If so, how should I do this? Or is there a way to direct PyCharm to the location of PyQt5 from within my code?

E_net4
  • 27,810
  • 13
  • 101
  • 139
Wes Tomer
  • 319
  • 1
  • 13
  • 1
    It's all okay. It's saying that you don't have "location" package. `pip show` tries to find package `location` first - you dont have it, then it lists `pyqt5` – Dawid Gacek Jul 30 '20 at 19:45
  • Are you sure pycharm is using the python where you installed pyqt5? – eyllanesc Jul 30 '20 at 19:49
  • @eyllanesc great question. I will try to find that out! – Wes Tomer Jul 30 '20 at 19:56
  • @eyllanesc -- so I went to PyCharm > Settings > Project > Project Interpreter > +Package > searched for and selected PyQt5 and clicked `Install Package` > Which gave me an error: `Could not fetch URL https://pypi.org/simple/pyqt5/: There was a problem confirming the ssl certificate: ...` PyCharm also suggested: "Try to run this command from the system terminal." which I already did. What should I try now? – Wes Tomer Jul 30 '20 at 20:16

1 Answers1

1

I didn't realize it at first, but this question is really about PyCharm packages.

Solution:

  1. PyCharm > File > Settings
  2. Project > click + to add package
  3. type PyQt5

Make sure your proxy settings are correct (mine weren't at first). Now it's working. If you need a proxy:

  1. PyCharm > File > Settings
  2. Version Control > Subversion > Network > Navigate to general proxy settings
  3. Check automatic or manual and fill in details > OK
Wes Tomer
  • 319
  • 1
  • 13