使用应用程序分发最小的 python 安装

发布于 2024-09-13 18:45:54 字数 590 浏览 3 评论 0原文

我的公司正在开发一个应用程序,该应用程序一半用于编辑器界面,一半使用 Django(通过 QtWebKit 浏览器控件)用于运行时。我们想要做的是用我们的应用程序分发一个最小的 python 安装。

例如,我们的 Mac 应用程序包的理想结构应如下所示:

TheApp.app/
   Contents/
      MacOS/
         TheApp
      Resources/
         MinimalPythonInstallation/

在 Windows 上:

C:\Program Files\TheApp\
   TheApp.exe
   MinimalPythonInstallation\

我见过很多用于分发完整 Python 应用程序的项目,例如 py2app、py2exe 和 PyInstaller。这些似乎具有我正在寻找的一些功能,但无法制作一个最小的 python 发行版。即 python 可执行文件、Django 以及 Django 所需的最低限度的 python 标准库、我们的 python 代码等。

有没有什么可以做我正在寻找的事情?

My company is working on an application that is half Qt/C++ for the editor interface and half Django (via QtWebKit browser control) for the runtime. What we want to do is distribute a minimal python installation with our application.

For instance, our Mac app bundle would ideally be structured something like this:

TheApp.app/
   Contents/
      MacOS/
         TheApp
      Resources/
         MinimalPythonInstallation/

On Windows:

C:\Program Files\TheApp\
   TheApp.exe
   MinimalPythonInstallation\

I've seen plenty of projects out there for distributing full Python applications such as py2app, py2exe, and PyInstaller. Those seem to have some of the features I'm looking for, but without the ability to just make a minimal python distribution. i.e. the python executable, Django, and the bare minimum of the python standard library needed by Django, our python code, etc.

Is there anything out there that can do what I'm looking for?

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

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

发布评论

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

评论(1

梦巷 2024-09-20 18:45:54

您可以使用 modulefinder 找到所需的模块集 - 事实上,我相信这就是您提到的系统(例如 py2exe 和 PyInstaller )为您做的事情的关键部分,所以我不清楚您为什么要“重新发明轮子”——介意澄清一下吗?您是否仔细查看过 PyInstaller 在其生成的可执行文件中放入的内容,如果是这样,为什么这对您来说还不够好?如果您详细解释一下,也许我们可以提供一些额外的帮助。

(PyInstaller 是跨平台的,因此,如果您想支持 Mac 和 Windows,它可能就是您想要的,因为 py2exe 仅适用于 Windows)。

You can find the set of modules you need with modulefinder -- indeed, I believe that's a key part of what the systems you mention, like py2exe and PyInstaller, do for you, so I'm not clear why you want to "reinvent the wheel" -- care to clarify? Have you looked at exactly what e.g. PyInstaller puts in the executables it generates, and, if so, why isn't that good enough for you? If you explain this in detail, maybe there's some extra way we can help.

(PyInstaller is cross-platform, so, if you want to support Mac as well as Windows, it's probably the one you'll want, since py2exe is Windows-only).

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