import sysfrom PyQt4 import QtGui app = QtGui.QApplication(sys.argv) widget = QtGui.QWidget() widget.resize(250, 150) widget.setWindowTitle('UI') widget.show() sys.exit(app.exec_())
from distutils.core import setupimport py2exe setup(windows=['UI.py'])
Traceback (most recent call last): File "UI.py", line 2, in <module> File "PyQt4\QtGui.pyc", line 12, in <module> File "PyQt4\QtGui.pyc", line 10, in __load ImportError: No module named QtCore
python setup.py install
python setup.py py2exe --includes sip
我编译的过程没有问题,但是运行exe文件就出现以上错误。QT pyqt的路径都没有问题的。而且我曾经成功过一次,后来怎么都不行了。。。
慕森王
陪伴而非守候