Introducing
The Slant team built an AI & it’s awesome
Find the best product instantly
Add to Chrome
Add to Edge
Add to Firefox
Add to Opera
Add to Brave
Add to Safari
Try it now
4.7 star rating
0
Development
What are the best tools for creating packaged executables for Python?
7
Options
Considered
27
User
Recs.
Jan 13, 2024
Last
Updated
Related Questions
Activity
Have feedback or ideas?
Join our community
on Discord
Ad
7
Options
Considered
Best tools for creating packaged executables for Python
Price
Last Updated
--
Nuitka
-
Nov 5, 2023
--
cx_Freeze
-
Nov 30, 2023
--
Pyinstaller
-
Jan 13, 2024
--
py2app
-
May 15, 2022
--
pynsist
-
Oct 29, 2019
See Full List
--
Nuitka
My Rec
ommendation
for
Nuitka
My Recommendation for
Nuitka
All
11
Pros
9
Cons
2
Top
Pro
•••
Source code can be obfuscated
As it compiles to C/C++, no Python Bytecode is left. As a result, the code is obfuscated enough to prevent most cases of tampering.
See More
Top
Con
•••
Needs to be used with caution
Even though it goes through multiple tests before release, things can still break. For example, it needs configuration tweaks to work with some third-party packages, ir could cause app crashes, or fail to include dependencies.
See More
Top
Pro
•••
Excellent performance optimizations
It's the best tool for performance conscious users. It turns Python code into C/C++ code instead of freezing it, and, as an ahead-of-time compiler, performs several optimizations when compiling Python code into C/C++ code, improving performance significantly. Some of this optimizations are constant folding (which means that if a variable stores the result of 3+3, Nuitka already knows it is 6 at execution time), conditional-statement predictions, and quicker function calls. This benchmark can be useful for comparing Nuitka's performance against Python's performance.
See More
Top
Con
•••
Does not work with Pyenv on MacOS
See More
Top
Pro
•••
Compatible with most Python versions
Nuitka can replace the standard Python interpreter and compile to every construct that CPython 2.6, 2.7, 3.3, 3.4, 3.5, 3.6, and 3.7 has.
See More
Top
Pro
•••
Easy to use
You can turn a Python script to an executable with all the modules embedded by running the following command python -m nuitka --follow-imports program.py.
See More
Top
Pro
•••
Can produce standalone executables
The --standalone argument creates executables that can run on machines that don't have Python installed or other dependencies needed for the script to run all in one single file.
See More
Top
Pro
•••
Is optimized to avoid overhead
Avoids big file sizes by only including what is needed for your script to run.
See More
Top
Pro
•••
Fully compatible with standard Python modules
Nuitka can be used with all Python standard libraries, modules, and extension modules.
See More
Top
Pro
•••
Covers most use-cases
Can compile a Python App into an executable, an extension module or a program with modules embedded.
See More
Top
Pro
•••
Supports all major OS platforms
Available on Linux, FreeBSD, NetBSD, macOS, and Windows 64/32 bits
See More
Hide
See All
Get it
here
Recommend
7
--
cx_Freeze
My Rec
ommendation
for
cx_Freeze
My Recommendation for
cx_Freeze
All
6
Pros
2
Cons
4
Top
Pro
•••
It's cross platform
If you have a Python Script, you can use cx_Freeze to turn it into an executable on the platform you use it for. It will run on any platform where Python itself runs on. Note, however, that it can't cross-compile.
See More
Top
Con
•••
Needs you to use a setup script
Won't detect that a file needs to be copied if it is not dynamically loaded by your program, you have to tell cx_Freeze about it in a setup script.
See More
Top
Pro
•••
Egg support
Support for searching zip files (.egg files) for modules.
See More
Top
Con
•••
Not a cross-compiler
While you can use cx_Freeze on any platform where python itself works on, you can't cross-compile (compile an app for another platform).
See More
Top
Con
•••
Source code can be obtained
Since cx_Freeze does not provide solutions to reverse engineering or decompiling. Python bytecode can be obtained and the logic of your app can be exposed.
See More
Top
Con
•••
Single file mode not supported
Can't compile all your script modules, dependencies and archives into a single executable stand alone file.
See More
Hide
See All
Get it
here
Recommend
5
1
--
Pyinstaller
My Rec
ommendation
for
Pyinstaller
My Recommendation for
Pyinstaller
All
12
Experiences
2
Pros
7
Cons
3
Top
Pro
•••
Easy to use
PyInstaller is one of the best tools for easily freezing Python Scripts and Modules into self-contained executables. It can be used via CLI with a single command and without many configurations. This tool pulls all the necessary files and libraries needed into a file to have your program run on any PC as an executable app.
See More
Top
Con
•••
OS Specific
Any executable created can only run on the OS, bit size, and python version it was created on. If you want to create a package that runs on another machine you will need to know these exact parameters in order for it to function.
See More
KnowledgeablePhrike's Experience
This program is a waste of disk space.
See More
Top
Pro
•••
Easy install
Simply pip install pyinstaller and it is ready to go.
See More
Top
Con
•••
Not highly configurable
There is an option to dictate that the package should be completely run from one file, but other than a few other modification commands pyinstaller is not very configurable.
See More
standupberowdy's Experience
So going through all of the recommended libraries on here, pyinstaller was the most effortless along with nuitka (nuitka is used specifically for compiling to
See More
Top
Pro
•••
Executables can be compressed with UPX to reduce their size drastically
Executables can be compressed with UPX, a free utility. You can see how it works here. Note that currently, it has no effect on macOS 64-bit.
See More
Top
Con
•••
Fails to produce .exe
Produces nothing in the \dist directory, no .exe file, nothing except a \setup directory. A waste of disk space. I have a simple single python .py file, marginally above "hello", no user input, a simple parse of known binary file to a known text file. Copious unintelligible output to no effect.
See More
Top
Pro
•••
Compatible with most 3rd-party packages out-of-the-box
Most packages will work without any configuration. The community maintains a list of tested packages here. The list is incomplete so any user can contribute to it by editing the table or writing to the mailing list.
See More
Top
Pro
•••
Compatible with Cython modules
Pyinstaller can resolve, use, and package Cython modules into the executable.
See More
Top
Pro
•••
Can obfuscate Python byte code
Python bytecode can be obfuscated by specifying an encryption key with a CLI command. This should prevent most forms of tampering with the executable, such as reverse-engineering it to extract the underlying Python code. While the bytecode is encrypted using AES256, it should not be confused for security because the key can be extracted from the executable.
See More
Top
Pro
•••
Can add binariess to the executable
The --add-binary flag allows you to bundle external executables along with your script. You can, for example, bundle chromium or selenium.
See More
Hide
See All
Get it
here
Recommend
5
3
--
py2app
My Rec
ommendation
for
py2app
My Recommendation for
py2app
All
1
Cons
1
Top
Con
•••
Mac OSX only
This tool is designed to "Create standalone Mac OS X applications"
See More
Hide
Get it
here
Recommend
1
--
pynsist
My Rec
ommendation
for
pynsist
My Recommendation for
pynsist
All
1
Cons
1
Top
Con
•••
Windows only
This tool is designed to build python applications for windows, and cannot build for multiple platforms.
See More
Hide
Get it
here
Recommend
--
dh-virtualenv
My Rec
ommendation
for
dh-virtualenv
My Recommendation for
dh-virtualenv
Hide
Get it
here
Recommend
--
py2exe
My Rec
ommendation
for
py2exe
My Recommendation for
py2exe
Hide
Get it
here
Recommend
5
Don't see your favorite option? Add it.
Built By the Slant team
Find the best product instantly.
4.7 star rating
Add to Chrome
Add to Edge
Add to Firefox
Add to Opera
Add to Brave
Add to Safari
Try it now - it's free
One sec!
Are you sure that you want to abandon your hard work?
Delete Work
Continue working
{}
undefined
url next
price drop