【发布时间】:2015-09-15 09:43:52
【问题描述】:
我已经安装了 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_()
返回错误:
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\站点包\PyQt5\;
请注意。 谢谢
更新: 我在 C:\Python35\Lib\site-packages\PyQt5 中有 Qt5Widgets.dll 和 QtWidgets.pyd
【问题讨论】:
标签: windows qt python-3.x pyqt5