【问题标题】:PyQt5 stuck on import, but no error messagePyQt5 卡在导入上,但没有错误消息
【发布时间】:2017-06-17 16:37:31
【问题描述】:

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

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

【问题讨论】:

    标签: python


    【解决方案1】:

    这里的第一条评论解决了我的问题。 DLL load failed when importing PyQt5

    我卸载了 pyqt5 并重新安装了 conda install --channel https://conda.anaconda.org/bpentz pyqt5

    【讨论】:

      猜你喜欢
      • 2016-04-17
      • 1970-01-01
      • 1970-01-01
      • 2018-12-28
      • 2015-10-11
      • 2016-02-24
      • 2017-09-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多