PyQt5 failing import of QtGui

Viewed 88085

I've just moved from PyQt4 to 5 and I'm having an issue with QtGui. I installed using the 32bit windows installer, not my own build.

when I do:

from PyQt5 import QtGui

I get

class MainWindow(QtGui.QMainWindow, UI.MainUI.Ui_MainWindow):
AttributeError: 'module' object has no attribute 'QMainWindow'

so I tried

from PyQt5.QtWidgets import QtGui

Which results in:

ImportError: cannot import name QtGui

then I tried to change the sys.path according to Pyinstaller: ImportError: cannot import name QtGui work around but it still gives me the same

ImportError: cannot import name QtGui

Update: It looks like I do in fact import QtGui because when I go in IDLE and try it, it still autocompletes QMovie and a whole bunch of other attributes. Is there any reason QMainWindow just wouldn't be in there? (It's not, neither is QDialog and they seem important)

1 Answers
Related