49

Are there any alternatives to py2exe?

daniels
  • 18,416
  • 31
  • 103
  • 173

4 Answers4

59

pyInstaller is cross-platform and very powerful, with many third-party packages (matplotlib, numpy, PyQT4, ...) specially supported "out of the box", support for eggs, code-signing on Windows (and a couple other Windows-only goodies, optional binary packing... the works!-) The one big issue: the last "released" version, 1.3, is ages-old -- you absolutely must install the SVN trunk version, svn co http://svn.pyinstaller.org/trunk pyinstaller (or the 1.4 pre-release, but I haven't tested that one). A fair summary of its capabilities as of 6 months ago is here (in English, despite the Italian URL;-).

Andrea Ambu
  • 38,188
  • 14
  • 54
  • 77
Alex Martelli
  • 854,459
  • 170
  • 1,222
  • 1,395
  • pyInstaller looked like the most robust of those I tried recently (pyInstaller, cx_Freeze, bbfreeze). Additionally to what Alex mentioned, offers a "no-console" option for Windows, correctly includes the modules, well-documented, is installed separately from the Python installation so you can switch between versions if need be. – RedGlyph Nov 07 '09 at 11:49
  • unfortunately no python3 support yet. the one python app i want to generate an exe for i happened to write in python3.1 :P – Matt Joiner Feb 16 '10 at 20:44
  • PyInstaller rocks! I only had one little issue with ctypes since it couldn't find the referenced DLL, but after manually copying it to the output folder everything worked perfectly! – Jorge Vargas Oct 21 '11 at 18:50
  • 5
    Note: PyInstaller has been moved to GitHub. See: https://github.com/pyinstaller/pyinstaller – Ian C. Aug 02 '12 at 15:30
  • pyinstaller works well but sadly seems to have issues with many anti-virus vendors. Although I have not had issues with false positives, it seems to take an age to scan the .exe when it starts, and I cannot possibly test for all the various AV packages out there. For code you intend to release in the wild, this kind of problem could become very painful. (I am using 3.5) – danmcb Dec 31 '19 at 13:09
25

cx_Freeze is cross-platform and does the same, or you could use py2app, which works on mac only.

Reshure
  • 3,295
  • 5
  • 28
  • 26
20

Here's a list of them.

  1. Py2exe
  2. PyInstaller
  3. cx_Freeze
  4. bbfreeze
  5. py2app

You might also consider Nuitka, which compiles python to native code.

ʇsәɹoɈ
  • 22,757
  • 7
  • 55
  • 61
6

bbfreeze claims to works on Windows and UNIX, but not on OS X. It doesn't seem to be actively developed anymore, though.

Ville Laurikari
  • 28,380
  • 7
  • 60
  • 55
  • 3
    `bfreeze` and the programs it creates are unfortunately detected as malicious by anti-virus software (Norton in particular). It is a problem for users since you can hardly tell them to turn off such and such feature of their system protection. For the record, I personally hate those experimental anti-virus detection features. – RedGlyph Nov 07 '09 at 11:39
  • bbfreeze appears to have support for OSX on its trunk ("tip") version, though not in a released version. And I haven't tested it myself. – Peter Hansen Mar 18 '10 at 01:25
  • According to virustotal.com the executable that bbfreeze created for me is not being picked up by Norton as a virus. (Of course it could still be detected during runtime due to some "Behavioral Protection" magic.) – Tarnay Kálmán Apr 11 '10 at 23:03
  • bbfreeze worked for me where pyinstaller failed, see https://github.com/pyinstaller/pyinstaller/issues/2009 for details – Davide May 27 '16 at 21:16