Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is better - PyInstaller or cx_Freeze? [closed]

Could someone tell me which is better of the two for bundling Python applications — cx_Freeze or PyInstaller? I'm looking for a comparison based on factors such as:

  1. Popularity (i.e. larger user base)
  2. Footprint of the built binary
  3. Cross platform compatibility
  4. Ease of use
like image 302
Mridang Agarwalla Avatar asked Jul 22 '10 10:07

Mridang Agarwalla


People also ask

Which is better py2exe or PyInstaller?

In PyInstaller it is easy to create one exe, By default both create a bunch of exes & dlls. In py2exe its easier to embed manifest file in exe, useful for run as administrator mode in windows vista and beyond. Pyinstaller is modular and has a feature of hooks to include files in the build that you like.

Do you need Python installed to run a PyInstaller EXE?

They do not need to have Python installed at all. The output of PyInstaller is specific to the active operating system and the active version of Python. This means that to prepare a distribution for: a different OS.

What is cx_Freeze?

cx_Freeze is a set of scripts and modules for freezing Python scripts into executables, in much the same way that py2exe and py2app do. Unlike these two tools, cx_Freeze is cross-platform and should work on any platform that Python itself works on. It supports Python 2.7 or higher (including Python 3).


2 Answers

I tried both for a current project and decided to use cx_freeze. I found it easier to get started. It has an option to bundle dependencies in a zip archive, which makes it easy to check that everything was properly included.

I had trouble getting PyInstaller to include certain egg dependencies. It couldn't handle conditional imports as well as I needed and looking through the bundled archive was difficult. On Windows, it requires pywin32 (so it can't be used with virtualenv) and version 1.4 doesn't work with Python 2.6. There's no information on whether Python 2.7 is supported.

like image 98
Velociraptors Avatar answered Oct 18 '22 19:10

Velociraptors


Why not use something like GUI2EXE?

GUI2Exe is a Graphical User Interface frontend to all the "executable builders" available for the Python programming language. It can be used to build standalone Windows executables, Linux applications and Mac OS application bundles and plugins starting from Python scripts.

For my experience, I found that for some programs py2exe doesn't work right, but cx_freeze does. haven't tried pyinstaller.

like image 43
fseto Avatar answered Oct 18 '22 18:10

fseto