gpt4 book ai didi

python - 当我更改 EXE 名称时无法运行 PyInstaller 生成的 EXE

转载 作者:行者123 更新时间:2023-12-04 07:14:40 25 4
gpt4 key购买 nike

我无法将exe名称更改为除main以外的其他名称,也就是说,EXE只有在名称为“main”时才能正常工作,是否存在与exe名称的依赖关系?我的项目名为“studio”,我在输出目录中生成了 studio.exe,但我无法运行 exe,并出现以下错误:控制台输出:

ValueError: non-hexadecimal number found in fromhex() arg at position 17

虽然我将名称更改为“main”,但上面没有这样的错误。在尝试了很多方法之后我不明白为什么,有人可能有好主意吗?谢谢

最佳答案

在运行 pyinstaller 时使用 -n/--name 选项指定可执行文件的名称,而不是事后重命名可执行文件:

python pyinstaller.py --name=studio

深入分析问题可以引用下面的讨论: https://github.com/pyinstaller/pyinstaller/issues/1106

摘自 codewarrior0 的评论:

The above error is caused by the bootloader using the filename of itsexe to derive the filename of the manifest to load using CreateActCtx.The error occurs because the application manifest is not found whenthe onefile exe is renamed.

关于python - 当我更改 EXE 名称时无法运行 PyInstaller 生成的 EXE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68841854/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com