0
我想使用Python 3.4.3在PyCharm中使用PyQt5库。我已经安装的所有程序,但不是完全工作,PyCharm出现错误:为什么在PyQt5中使用Python 3.4.3和PyCharm存在ImportError?
C:\Python34\python.exeC:/Python34/Lib/sitepackages/PyQt5/examples/dbus/listnames.py
Traceback (most recent call last):
File "C:/Python34/Lib/site-packages/PyQt5/examples/dbus/listnames.py", line 47, in <module>
from PyQt5.QtCore import QCoreApplication
ImportError: DLL load failed: %1 is not a valid Win32 application.
Process finished with exit code 1
,我的代码只是这一点,这我从PyQt5导入模型PyCharm创建一个简单的窗口:
import sys
from PyQt5 import QtGui
def main():
app = QtGui.QApplication(sys.argv)
w = QtGui.QWidget()
w.resize(250, 150)
w.move(300, 300)
w.setWindowTitle('Simple')
w.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
只有当我使用PyCharm而不是可移植的Python时,才会出现此错误。那么有人能告诉我如何使用Python 3.4.3和PyQt5来设置PyCharm吗?如果这不是问题,请给我看解决方案。