【问题标题】:pyinstaller working but .exe application not staring uppyinstaller 工作但 .exe 应用程序没有启动
【发布时间】:2020-05-25 14:08:42
【问题描述】:

我尝试使用 pyinstaller 模块将我的 python gui 应用程序 (.py) 转换为可执行文件 (.exe)。我在终端中运行了以下命令 -

pyinstaller.exe --onefile -w sourcecode.py

该过程已成功完成,我得到了 .exe 文件(sourcecode.exe)以及 pycache 和 sourcecode 等额外文件夹。但是,当我尝试通过双击运行 .exe 文件/应用程序时,应用程序没有启动并出现错误。请帮忙。

【问题讨论】:

    标签: python python-3.x pyinstaller


    【解决方案1】:

    尝试将此--hidden-import 添加到pyinstaller.exe --onefile -w sourcecode.py 以防隐藏模块。

    您也可以尝试添加--debug 以查看实际错误。

    【讨论】:

    • 无论如何我使用 cx_Freeze 而不是 pyinstaller 并且效果很好。不过这个过程有点漫长。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-10
    • 2016-03-25
    • 2021-08-07
    • 2010-09-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多