PyQt5 and QtGui module not found

When first trying pyqt4 and pyqt5 and the pycharm IDE I had many problems with imports. (although the imports had no prob running from IDLE) Eventually after much stuffing around, uninstalling and reinstalling, (including dependencies) the imports sorted themselves out.

Did you install pyqt5 using an installer from the pyqt website? You must.
Qt designer is found under the start menu in windows.
When following PyQt4 tutorials, I have had luck using the following import statements for PyQt5…

from PyQt4 import QtCore, QtGui #in the pyqt4 tutorials
from PyQt5 import QtCore, QtGui, QtWidgets #works for pyqt5

I’m new to it myself but in pyqt4, QtWidget was part of QtGui (QtGui.QtWidget), in pyqt5 it gets imported by itself as QtWidgets. Its only a small change in code to get the pyqt4 tutorials working in pyqt5.

I personally went back to pYqt4 to take advantage of pyqtgraph.

Look at my pyqt4 post here which walks you through using Qt Designer.

Leave a Comment