Python3.5 在 Win7x64 上无法从 Qt5 模块 QtWidgets 加载

Python3.5 on Win7x64 can not load from Qt5 module QtWidgets

我已经安装了 python 3.5.0

Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32

然后安装Qt5:pip install python-qt5.

此处代码:

import sys
from PyQt5 import QtWidgets
app = QtWidgets.QApplication(sys.argv)
button = QtWidgets.QPushButton("Hello")
button.setFixedSize(400, 400)
button.show()
app.exec_()

它return错误:

C:\Python35\python.exe C:/py_test/test_qt5/main.py
Traceback (most recent call last):
  File "C:/py_test/test_qt5/main.py", line 2, in <module>
    from PyQt5 import QtWidgets
ImportError: DLL load failed: The specified module could not be found.

这是我的路径:

C:\Python35\Scripts\;C:\Python35\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C :\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Skype\Phone \;C:\Python35\Lib\site-packages\PyQt5\;

请告知。 谢谢

更新: 我在 C:\Python35\Lib\site-packages\PyQt5

中有 Qt5Widgets.dll 和 QtWidgets.pyd

你有 C:\Python35\Lib\site-packages\PyQt5\ 中的二进制文件还是 C:\Python35\Lib\site-packages\PyQt5\bin 中的二进制文件?

检查 C:\Python35\Lib\site-packages\PyQt5\bin 是否存在并将路径添加到您的环境 PATH 变量。

因此,PyQt5 将无法与 python3.5

一起使用

降级到 python 3.4 已解决问题