Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python executables: py2exe or PyInstaller?

To create executable files (windows) I assume that we should use one of them: Py2exe or PyInstaller.

What are the difference between them?

like image 811
trante Avatar asked Jun 02 '11 09:06

trante


People also ask

Is there an alternative to PyInstaller?

There are five alternatives to PyInstaller for Windows, Linux and Mac. The best alternative is nuitka, which is both free and Open Source. Other great apps like PyInstaller are py2exe, cx_Freeze, Shed Skin and bbfreeze.

Why is PyInstaller so slow?

PyInstaller's bootloader is usually quite fast in one-dir mode, but it can be much slower in one-file mode, because it depacks everything into a temporary directory. On Windows, I/O is very slow, and then you have antiviruses that will want to double check all those DLL files. PyQt itself is a non-issue.


2 Answers

Py2exe and PyInstaller both are wrappers but here are few differences that I noticed,

  1. Py2exe is compatible with python2.4+ including python3.0 & 3.1 whereas PyInstaller is currently, compatible with python 2.7 and 3.3–3.5
  2. As far I know, Py2exe didn't support signing whereas Pyinstaller has support for signing from version 1.4
  3. In PyInstaller it is easy to create one exe, By default both create a bunch of exes & dlls.
  4. In py2exe its easier to embed manifest file in exe, useful for run as administrator mode in windows vista and beyond.
  5. Pyinstaller is modular and has a feature of hooks to include files in the build that you like. I don't know about this feature in py2exe.

Hope this helps you in your decision making.

[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.

like image 90
Gagandeep Singh Avatar answered Oct 13 '22 15:10

Gagandeep Singh


From the message of the wikipedia,py2exe is not active for long time :

Stable release: 0.9.2.2 for Python 3 /; 21 October 2014; 0.6.9 for Python 2 /; 15 November 2008

So I advise to use the pyinstaller.....

But now the pyinstaller also meet the problemThe offical website of pyinstaller:

Help keeping PyInstaller alive: Maintaining PyInstaller is a huge amount of work. PyInstaller development can only continue if users and companies provide sustainable funding. See Funding PyInstaller for how to support PyInstaller.

like image 35
five element god Avatar answered Oct 13 '22 15:10

five element god