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

2024-09-30 04:33:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我用conda安装了PyQt5:conda install-c inso PyQt5=5.6。我有python3.5。当我运行一个使用PyQt5的简单程序时,该程序在PyQt5导入时卡住,并且没有错误消息。它被卡住了大约5秒钟,然后程序就终止了。请看下面我在google上找到的例子。程序卡在from PyQt5.QtWidgets import QApplication, QWidget行上。我可以在C:\Users\user\Anaconda3\Lib\site packages\PyQt5中看到packcage。是什么导致了这种行为

"""
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_())

Tags: installfromimport程序app消息错误sys

热门问题