py2exe-生成单个可执行文件 [英] py2exe - generate single executable file

查看:111
本文介绍了py2exe-生成单个可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以为我听说 py2exe 能够做到这一点,但我从未弄清楚.有人成功做到了吗?我可以查看您的setup.py文件以及您使用的哪些命令行选项吗?

I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used?

基本上,我正在考虑将其提供给我一个可执行文件,该文件的功能类似于将自身解压缩到/temp并运行.

Basically I'm thinking of it giving me a single executable file that does something like unzips itself to maybe /temp and runs.

推荐答案

PyInstaller 将创建一个.exe没有依赖关系的文件;使用--onefile选项.它通过将所有需要的共享库打包到可执行文件中,然后在运行之前解压缩它们来完成此操作,正如您所描述的那样(py2exe也具有此功能,请参见

PyInstaller will create a single .exe file with no dependencies; use the --onefile option. It does this by packing all the needed shared libs into the executable, and unpacking them before it runs, just as you describe ( py2exe also has this feature, see minty's answer)

由于最新版本(1.3)已过时,因此我使用svn的PyInstaller版本.对于依赖于PyQt,PyQwt,numpy,scipy等应用程序的应用程序来说,它的运行情况非常好.

I use the version of PyInstaller from svn, since the latest release (1.3) is somewhat outdated. It's been working really well for an app which depends on PyQt, PyQwt, numpy, scipy and a few more.

这篇关于py2exe-生成单个可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆