How to Easily Turn Your Python Application Into an Executable

How to Easily Turn Your Python Application Into an Executable

Python is always fun to use in quick scripts, I use it a lot in my freelancing projects when I want to get the job done quickly, or when a library in python can make it easy to get the job done.

Why turn your python application into an executable?

The downside of using Python compared to something like Golang, is the packaging part, whenever you deal with a client who isn't very tech-savvy, it's always a pain to teach them how to run "pip install" or even to change the directory into a program's folder.

I usually tend to package the python program in an executable, using PyInstaller or cx_freeze. This allows me to bundle the python application and its dependencies into a single file or folder that can be executed by any client.

Why should I use auto-py-to-exe. ?

The simple answer is time, using PyInstaller is fine, in the end, auto-py-to-exe is just a GUI that uses PyInstaller. I don't need to remember all the options and keep looking for them in the documentation anymore.

Auto-py-to-exe comes with all the features that I need (and don't need), and it's simple to install and use, it is a really good tool for improving productivity if you rely on PyInstaller a lot.

Installing auto-py-to-exe.

simply use pip to install the latest version of the package.

pip install auto-py-to-exe

Prerequisites: Python 3.6 or latest.

Using auto-py-to-exe.

To run the GUI simply run the command in your terminal.

auto-py-to-exe

:warning: If you encounter "command not found" you probably have a problem with your path variables, you can still run it using the following command.

python -m auto_py_to_exe

This should open a window in your browser, using the program is very straightforward, you need to add the path to your file and change any settings you want to change before converting.

auto-py-to-exe.png

If your python program relies on any other files to execute, make sure to include them in the "Additional Files" section.

What I really like about auto-py-to-exe is that it shows the PyInstaller command in the bottom section that it executes, which makes it a great tool for people who want to get started easily with PyInstaller.