【问题标题】:PyQt5 on Windows in Python 2.7: Error importing QtWidgetsPython 2.7 中 Windows 上的 PyQt5:导入 QtWidgets 时出错
【发布时间】:2016-02-17 17:18:39
【问题描述】:

我在 Windows 7 上为 python 2.7 下载了 PyQt5 可执行文件,两个 64 位版本。

安装在 C:\Python27\Lib\site-packages\PyQt5

我正在尝试使用上面的代码:

from PyQt5.QtWidgets import QApplication, QDialog 

我得到错误:

ImportError: DLL load failed: The specified module could not be found.

我在这个文件夹中找到了 QtWidgets:C:\Python27\Lib\site-packages\PyQt5\sip\PyQt5\QtWidgets

你有什么想法吗?

【问题讨论】:

    标签: python python-2.7 pyqt5


    【解决方案1】:

    您确定安装了与您的 Python 版本(32 位或 64 位)兼容的 PyQt5 版本吗?

    【讨论】:

    • 你是对的! PyQt5 与 Python 2.7 不兼容。它仅与 Python 3.4 兼容。我下载了 PyQt4,它工作正常!感谢您的回复!
    猜你喜欢
    • 2019-08-06
    • 2014-05-01
    • 2021-04-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-16
    • 2016-05-18
    相关资源
    最近更新 更多