Easy Steps to Create an Executable in Python Using PyInstaller
Guide to create a Python executable file using PyInstaller.
Published in
7 min readJul 30, 2020
In this article, you will learn to
- Install PyInstaller,
- Understand what does PyInstaller do to create an executable
- Create a simple executable
- Add data files used by the executable
- Add additional imports to the executable
- Understand .Spec file and its usage
Installing PyInstaller
Installing PyInstaller is easy and is very similar to installing any python library.
pip install PyInstaller
You can check the version of PyInstaller.
pyinstaller --version
I am using PyInstaller version 3.6.
Creating an executable using PyInstaller
PyInstaller bundles Python application and all its dependent libraries into one package, and it does this by
- Reading the script file.
- Analyzing the python code to identify all the dependent libraries required for the execution
- Creates a Spec file that…