PyInstaller 和 cx_Freeze 哪个更好?

发布于 2024-09-10 22:25:49 字数 170 浏览 0 评论 0原文

有人可以告诉我对于捆绑 Python 应用程序来说,cx_Freeze 或 PyInstaller 这两者中哪一个更好?我正在寻找基于以下因素的比较:

  1. 受欢迎程度(即更大的用户群)
  2. 构建的二进制文件的占用空间
  3. 跨平台兼容性
  4. 易用性

Could someone tell me which is better of the two for bundling Python applications — cx_Freeze or PyInstaller? I'm looking for a comparison based on factors such as:

  1. Popularity (i.e. larger user base)
  2. Footprint of the built binary
  3. Cross platform compatibility
  4. Ease of use

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

萌梦深 2024-09-17 22:25:49

我在当前项目中尝试了这两种方法,并决定使用 cx_freeze。我发现更容易上手。它可以选择将依赖项捆绑到 zip 存档中,这样可以轻松检查所有内容是否已正确包含。

我无法让 PyInstaller 包含某些 Egg 依赖项。它无法按照我的需要处理条件导入,并且查看捆绑的存档很困难。在 Windows 上,它需要 pywin32(因此它不能与 virtualenv 一起使用),并且版本 1.4 不能与 Python 2.6 一起使用。没有关于是否支持 Python 2.7 的信息。

I tried both for a current project and decided to use cx_freeze. I found it easier to get started. It has an option to bundle dependencies in a zip archive, which makes it easy to check that everything was properly included.

I had trouble getting PyInstaller to include certain egg dependencies. It couldn't handle conditional imports as well as I needed and looking through the bundled archive was difficult. On Windows, it requires pywin32 (so it can't be used with virtualenv) and version 1.4 doesn't work with Python 2.6. There's no information on whether Python 2.7 is supported.

岛徒 2024-09-17 22:25:49

为什么不使用 GUI2EXE 之类的东西?

GUI2Exe 是图形用户界面
所有“可执行文件”的前端
构建器”可用于Python
编程语言。可以用
构建独立的 Windows
可执行文件、Linux 应用程序和
Mac OS 应用程序包和插件
从 Python 脚本开始。

根据我的经验,我发现对于某些程序 py2exe 无法正常工作,但 cx_freeze 可以。没有尝试过pyinstaller。

Why not use something like GUI2EXE?

GUI2Exe is a Graphical User Interface
frontend to all the "executable
builders" available for the Python
programming language. It can be used
to build standalone Windows
executables, Linux applications and
Mac OS application bundles and plugins
starting from Python scripts.

For my experience, I found that for some programs py2exe doesn't work right, but cx_freeze does. haven't tried pyinstaller.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文