简体   繁体   English

PyQt5卡在导入,但没有错误消息

[英]PyQt5 stuck on import, but no error message

I installed PyQt5 with conda this way: conda install -c inso pyqt5=5.6. 我用conda这样安装了PyQt5:conda install -c inso pyqt5 = 5.6。 I have python 3.5. 我有python 3.5。 When I run a simple program that uses PyQt5, the program gets stuck on PyQt5 import and there is no error message. 当我运行一个使用PyQt5的简单程序时,程序卡在PyQt5导入上,并且没有错误消息。 It gets stuck for about 5 seconds, then the program just terminates. 它会卡住大约5秒钟,然后程序才会终止。 See the example below that I found on google. 请参阅我在谷歌上找到的以下示例。 The program gets stuck on the line from PyQt5.QtWidgets import QApplication, QWidget . 该程序from PyQt5.QtWidgets import QApplication, QWidget上线。 I can see the packcage in C:\\Users\\user\\Anaconda3\\Lib\\site-packages\\PyQt5. 我可以在C:\\ Users \\ user \\ Anaconda3 \\ Lib \\ site-packages \\ PyQt5中看到packcage。 What might be causing suck a behavior? 什么可能导致吮吸行为?

"""
ZetCode PyQt5 tutorial 

In this example, we create a simple
window in PyQt5.

author: Jan Bodnar
website: zetcode.com 
last edited: January 2015
"""

import sys
from PyQt5.QtWidgets import QApplication, QWidget


app = QApplication(sys.argv)

w = QWidget()
w.resize(250, 150)
w.move(300, 300)
w.setWindowTitle('Simple')
w.show()

sys.exit(app.exec_())

First comment here solved my problem. 这里的第一条评论解决了我的问 DLL load failed when importing PyQt5 导入PyQt5时DLL加载失败

I uninstalled pyqt5 and reinstalled wtih conda install --channel https://conda.anaconda.org/bpentz pyqt5 我卸载了pyqt5并重新conda install --channel https://conda.anaconda.org/bpentz pyqt5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM