我在这个 Windows 7 32 位上安装了 python3.3 x86(官方 python.org 安装程序)
然后从此处为 python3.3 windows x86 安装 PyQt4-4.10 PyQt4-4.10-gpl-Py3.3-Qt5.0.1-x32-2.exe,也是官方安装程序,完整的 PyQt4 安装(包括 Qt 运行时)
我仔细检查了 python 和 PyQt4 都在 $PATH
但似乎我可以导入一些包(例如,QtCore)但不能导入其他包(例如,QtGui)
尽管他们并肩走在同一条路上
>>> from PyQt4 import QtCore
>>> QtCore.__file__
'C:\\Python33\\lib\\site-packages\\PyQt4\\QtCore.pyd'
>>> from PyQt4 import QtGui
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
from PyQt4 import QtGui
ImportError: DLL load failed: The specified module could not be found.
>>> import os
>>> os.path.exists('C:\\Python33\\lib\\site-packages\\PyQt4\\QtGui.pyd')
True
>>> from PyQt4 import Qt
>>> from PyQt4 import QtXml
>>> from PyQt4 import QtNetwork
>>> from PyQt4 import QtDesigner
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
from PyQt4 import QtDesigner
ImportError: DLL load failed: The specified module could not be found.
>>> os.path.exists('C:\\Python33\\lib\\site-packages\\PyQt4\\QtDesigner.pyd')
True