【发布时间】:2019-08-03 20:10:16
【问题描述】:
当我运行由 pyinstaller 创建的 .exe 时,它会显示如下屏幕截图所示的错误消息。
我使用 Python 3.6.4、pyinstaller 3.4 和 PyQt5 5.12 在 Windows 10 中制作我的 GUI 程序。为什么在运行 .exe 时 .exe 需要 PySide 模块和 PyQt4?我不明白。 .py 可以运行,没有任何错误。
实际上,在我收到此错误之前,我在生成 exe 的过程中遇到了错误Exception:Cannot find PyQt4 plugin directories,但我认为我不需要 PyQt4,所以我将其卸载。然后 pyinstaller 进程继续进行,直到出现新错误。
Exception:
Cannot find existing PyQt5 plugin directories
Paths checked: C:/qt64/qt_1544645195969/_h_env/Library/plugins
我通过将pyqt5qmlplugin.dll复制到上面提到的路径C:/qt64/qt_1544645195969/_h_env/Library/plugins解决了这个问题。最后我得到了 .exe,但不幸的是我仍然得到了屏幕截图中显示的错误,我无法使用 pip 安装 PyQt4。它报告:
Could not find a version that satisfies the requirement PyQt4 (from versions: )
No matching distribution found for PyQt4
我也无法安装 PySide,因为 only these Python versions are supported: [(2.6), (2.7), (3.2), (3.3), (3.4)]。
【问题讨论】:
标签: python pyqt5 pyside pyinstaller