如何使用外部 python 库打包我的 python 应用程序?
我希望我的标题很清楚。我正在使用 wxpython 制作 GUI,我希望它能够打开、提取并在所有操作系统上运行。我能够通过在斜纹档案中找到一个名为 twill 的文件夹来包含斜纹,效果很好。但是,我无法弄清楚如何正确打包 wxpython。
编辑:我也不使用。 py2exe仅适用于windows,而bbfreeze似乎不适用于mac(因此它不是跨平台的)
I hope my title was clear. I'm using wxpython for making a GUI and I want it to be able to be opened, extracted, and have it work on all operating systems. I was able to include twill by finding a folder called twill inside the twill archive, which worked fine. However, I'm unable to figure out how to correctly package wxpython.
EDIT: I'm not using either. py2exe is only for windows, and bbfreeze doesn't seem to work on mac (so it's not cross platform)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不幸的是,没有一站式解决方案可以让单个可安装的可执行文件在所有操作系统上运行。正确的解决方案实际上是为每个操作系统提供不同的安装程序或可执行文件;对于Windows,使用
py2exe
,对于Mac,py2app
是一个不错的选择,对于Linux,您应该只提供一个带有合理setup.py
的tarball > (无论如何,前两个你都需要)。Unfortunately, there's just no one stop solution so that a single installable executable will work across all operating systems. The right solution is really to provide a different installer or executable for each OS; For windows, use
py2exe
, for mac,py2app
is a good choice, and for linux you should just provide a tarball with a reasonablesetup.py
(that you will need for the first two, anyway).你应该听从 TokenMacGuy 的推荐。但我更愿意使用能够冻结所有操作系统的应用程序的工具,而不是使用不同的操作系统。
就这些条款而言,cx_freeze 是一个不错的选择。
这是另一个不错的选择:
You should go with the recommendation of TokenMacGuy. But I preferrably would use a tool which is able to freeze the application for all OS instead of using different ones.
cx_freeze is a good choice regarding these terms.
This is another fine alternative:
您是否尝试过 http://cx-freeze.sourceforge.net/ ?
Have you tried http://cx-freeze.sourceforge.net/ ?