PyQt5 failing import of QtGui PyQt5 failing import of QtGui python python

PyQt5 failing import of QtGui


Assuming everything was installed correctly, you need to adjust your imports slightly to port from PyQt4 to PyQt5.

The main GUI elements are in the QtWidgets module, whilst the more basic GUI elements are in QtGui. See the Qt modules page for more details.

The example code needs to be changed to something like:

from PyQt5 import QtCore, QtGui, QtWidgetsclass MainWindow(QtWidgets.QMainWindow, UI.MainUI.Ui_MainWindow):    ...

For more details on porting from PyQt4 to PyQt5, see: Differences Between PyQt4 and PyQt5.