问题描述
要创建可执行文件(Windows),我认为我们应该使用其中之一:Py2exe或PyInstaller.
To create executable files (windows) I assume that we should use one of them:Py2exe or PyInstaller.
它们之间有什么区别?
What are the difference between them?
推荐答案
Py2exe和PyInstaller都是包装器,但是我注意到的一些差异
Py2exe and PyInstaller both are wrappers but here are few differences that I noticed,
- Py2exe与python2.4 +兼容,包括python3.0& 3.1,而PyInstaller当前与python 2.7和3.3–3.5兼容
- 据我所知,Py2exe不支持签名,而Pyinstaller支持1.4版以上的签名
- 在PyInstaller中,很容易创建一个exe.默认情况下,两个都创建一堆exe& dlls.
- 在py2exe中,它更易于在exe中嵌入清单文件,对于在Windows Vista及更高版本中以管理员模式运行很有用.
- Pyinstaller是模块化的,具有挂钩功能,可以在所需的构建中包含文件.我不了解py2exe中的此功能.
希望这对您的决策有帮助.
Hope this helps you in your decision making.
[更新]-好像PyInstaller正在积极开发中( https://github.com/pyinstaller/pyinstaller/)并发布. py2exe仍在使用sourceforge,其发布周期在pypi上非常随机,2014年后没有构建,其代码也显示了2017年的发展( https://sourceforge.net/p/py2exe/svn/HEAD/tree/trunk/py2exe-3/py2exe/) .因此,我建议使用pyinstaller,直到py2exe稳定其发布周期,以对开发人员有利.
[Update] - It looks like PyInstaller is actively developed (https://github.com/pyinstaller/pyinstaller/) and released. py2exe is still using sourceforge and its release cycle is very random on pypi there is no build after 2014 and their code show development in 2017 as well (https://sourceforge.net/p/py2exe/svn/HEAD/tree/trunk/py2exe-3/py2exe/). So, I recommend using pyinstaller till the time py2exe stabilizes its release cycle in favor of developers.
这篇关于Python可执行文件:py2exe或PyInstaller?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!