Is there some reason that QtGui is packaged with PyQt5???
I am using Mark Summerfield's Rapid GUI programming book. Obviously this book was written with Qt4 in mind, but I have been recommended to use Qt5, and PyQt5. I want to run the first example code in chapter 4. The code begins with the following import statements:
import sys
import time
from PyQt5.QtCore import *
from PyQt5.QtGui import *
To which the compiler responds:
Traceback (most recent call last):
File "wakeUp.py", line 4, in <module>
from PyQt5.QtGui import *
ImportError: No module named 'PyQt5.QtGui'
Note that the PyQt5.QtCore import statement does not generate an error.
From the terminal,
$ echo $PYTHONPATH
:/usr/lib/python3.3/site-packages
Has anybody else come across this import error for QtGui?
From an interactive session I can
>>> import PyQt5.Qt
>>> import PyQt5.QtDBus
>>> import PyQt5.QtNetwork
>>> import PyQt5.QtXmlPatterns
But I don't have QtWidgets, QtGui, QtWebkit, QtDesigner, and several others.
Also, if it is helpful, the contents of /usr/lib/python3.3/site-packages/PyQt5 are:
__init__.py QtCore.so QtDBus.so QtNetwork.so Qt.so QtXmlPatterns.so uic
which are the same modules that I am able to import. Should the other modules (QtWidgets, QtGui etc) be here too?
I am using Ubuntu 13.04 and Python 3.3.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…