I am looking for a way to convert a Python Program to a .exe file WITHOUT using py2exe. py2exe says it requires Python 2.6, which is outdated. Is there a way this is possible so I can distribute my Python program without the end-user having to install Python?
You can just type pip install pyinstaller to install it and pyinstaller -w yourpythonscript.py to compile it to an exe.
Yes, it is possible to compile Python scripts into standalone executables. PyInstaller can be used to convert Python programs into stand-alone executables, under Windows, Linux, Mac OS X, FreeBSD, Solaris, and AIX. It is one of the recommended converters.
To convert the Python code into an executable file, we will be using Pyinstaller package. Use the standard 'pip install' command to install this package.
Understand that every 'freezing' application for Python will not really secure your code in any way. Every packaging system for a stand-alone executable Python 'program' will include a lot of the Python libraries and interpreter, which will make your program pretty large.
That said, PyInstaller has done a nearly flawless job with everything I've thrown at it. Currently it only supports up to Python 2.7 but Pyinstaller's support for a varied set of libraries large and small is unmatched in other 'freeze' type programs for Python.
I use cx_Freeze. Works with Python 2 and 3, and I have tested it to work on Windows, Mac, and Linux.
cx_Freeze: http://cx-freeze.sourceforge.net/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With