【发布时间】:2020-09-04 03:42:48
【问题描述】:
我已经为用户界面创建了一个使用 PyQt5 的程序,当使用 pyinstaller 将其转换为 .exe 文件时(使用行 >pyinstaller --onefile -w --hidden-import=pkg_resources.py2_warn pitch_trainer.py)我得到了一个可执行文件,但是当我尝试运行它时出现错误显示的消息。我一直在寻找类似的问题,但是我只能找到问题出在 QT 设计器的示例(例如 PyQt5 Designer is not working: This application failed to start because no Qt platform plugin could be initialized)。
【问题讨论】:
-
移除
--onefile选项 -
我现在试试并提供更新
-
我仍然收到同样的错误信息
-
1) 从 CMD 运行命令:
QT_DEBUG_PLUGINS=1 your.exe,2) 可执行文件旁边有哪些文件? 3)使用dependency walker查看是否缺少dll -
我得到
'QT_DEBUG_PLUGINS' is not recognized as an internal or external command, operable program or batch file.如果有帮助,在文件路径 C:...\pitch_trainer\PyQt5\Qt\plugins\platforms 中包含我的 exe 的文件夹中,我有文件 qminimal.dll, qoffscreen.dll 和 qwindows.dll
标签: python qt pyqt5 pyinstaller