繁体   English   中英

使用 pyinstaller 创建可执行文件时出现问题

[英]Problems creating an executable file with pyinstaller

我想使用 pyinstaller 从 python 文件生成一个可执行文件,我需要一些可以在 windows 上使用并希望在 ubuntu 上使用的东西。包含所有可执行文件的生成的 dist 文件夹是使用命令行创建的:

pyinstaller --debug=all gui.py

它使用 gui.py 文件创建 gui(可执行文件)。

做./gui output 是:

....
File "ssqueezepy/configs.py", line 150, in <module>
File "ssqueezepy/configs.py", line 107, in _get_gdefaults
FileNotFoundError: [Errno 2] No such file or directory: '/home/pietro/Desktop/ClaraGui/dist/gui/ssqueezepy/configs.ini'
[12263] Failed to execute script 'gui' due to unhandled exception!
[12263] LOADER: OK.
[12263] LOADER: Manually flushing stdout and stderr
[12263] LOADER: Cleaning up Python interpreter.
clear builtins._
clear sys.path
clear sys.argv
...

output 中没有其他错误(有时我读到在 PYZ 中找不到的“库的名称”)。 有办法解决上面的错误吗? 请求的 config.ini 文件是什么?

否则,还有其他的可能达到同样的结果吗? 最后我只需要一个可以在 windows 上使用的可执行文件,它是从 python 中的代码在 ubuntu 上生成的。

编辑:我解决了停用虚拟环境并在其外部安装依赖项的问题。 这不是解决方法,但它适用于我的情况。

您可以尝试打开命令提示符并将 exe 拖入其中,然后按回车键,这样您就会发现错误(如果有的话),然后更新您的问题,更多信息 == 更多帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM