python PyQt4导入错误ImportError: No module named pyqt4,pyqt4importerror,import sysfr


import sysfrom PyQt4 import QtGuiapp = QtGui.QApplication(sys.argv)widget = QtGui.QWidget()widget.resize(250, 150)widget.setWindowTitle('simple')widget.show()sys.exit(app.exec_())  

错误如下:

Traceback (most recent call last): File "", line 1,

infrom pyqt4 import qtgui

ImportError: No module named pyqt4

我已经安装了python-qt4,有兄弟说我没有设置好环境变量,不知道是不是这个原因。

求解! ``

光pip install pyqt4貌似并没有真正安装好pyqt
装pyqt4貌似还得装sip,

下面是官网的说明

PyQt4 Download
If you have purchased a commercial PyQt license then please login to your account using the details sent to you at the time of purchase.
Before you can build PyQt4 you must have already built and installed SIP

https://riverbankcomputing.co...

http://www.linuxdiyf.com/linu...
亲测有效

编橙之家文章,

评论关闭