6

我在这个 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
4

2 回答 2

6

Qt5Gui.dll 依赖于 D3dCOMPILER_43.dll,它是 DirectX 的一部分。您可以使用DirectX 最终用户运行时 Web 安装程序更新您的安装。

于 2013-03-29T20:23:44.653 回答
1

如果您不喜欢安装整个 DirectX,您可以执行以下操作:

First download the Directx redistributable: http://www.microsoft.com/en-us/download/details.aspx?id=8109 (this is a kind of self extracting MS-Cabinet-file)

Then in Linux for example (Debian based - should work similar on other distros):

sudo apt-get install cabextract
mkdir cabs
cabextract -d cabs -F JUN2010\* directx_Jun2010_redist.exe
cd cabs
mkdir x64
cabextract -d x64 -F \*.dll *_x64.cab

In Windows you can extract cab-files for example with Winrar. Some windows versions included a command line utility for cab-files - I think it was called extract.

于 2013-06-10T12:08:56.223 回答