python - 使用 pyinstaller 从 python 脚本为尽可能多的 Linux 发行版创建二进制文件

标签 python linux pyinstaller

今天我遇到了一个问题,我使用 pyinstaller 从一些 python 脚本创建了一个二进制文件。我在 fc17 上创建了二进制文件,但当我尝试在 fc18 上运行它时,出现了一个错误,该错误与 fc17 (1.0.0k) 和 fc18 (1.0.1e) 上的 openssl 版本不同有关。这引起了我对使用 pyinstaller 的能力的严重怀疑,因为我事先不知道我的二进制文件将在哪些 Linux 发行版上结束。每次我在 python 脚本中进行更改时,我都愿意构建一次二进制文件,但我负担不起拥有所有可能的 Linux 发行版并在每个发行版上构建二进制文件。在使用 pyinstaller 构建应用程序时,是否有处理各种 Linux 发行版的方法?

最佳答案

我想你要找的是cx_freeze

cx_Freeze is a set of scripts and modules for freezing Python scripts into executables, in much the same way that py2exe and py2app do. Unlike these two tools, cx_Freeze is cross platform and should work on any platform that Python itself works on. It supports Python 2.3 or higher (including Python 3), since it makes use of the zip import facility which was introduced in 2.3.

关于python - 使用 pyinstaller 从 python 脚本为尽可能多的 Linux 发行版创建二进制文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19283689/

相关文章:

python - 我可以获得 TensorFlow Lite 模型的指标吗?

python - Pyinstaller非法指令4(其他电脑)

python - Pyinstaller 的综合教程?

linux - 每六个小时在 Linux 上运行一次 cron 作业

linux - 查找和排序目录

python - 从 python 代码构建 exe 以避免 AV 误报的最佳方法

python - 将参数传递给 Spyder 以调试文件

python - 在Python中将二进制数转换为十六进制数不适用于超过5位的数字(家庭作业)

python - 如何在Python中按总和和平均列进行分组?

c - 与我自己的 glibc 链接