Easy Steps to Create an Executable in Python Using PyInstaller

Guide to create a Python executable file using PyInstaller.

Renu Khandelwal
The Startup

--

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
Photo by Karl Pawlowicz on Unsplash

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…

--

--

Renu Khandelwal
The Startup

A Technology Enthusiast who constantly seeks out new challenges by exploring cutting-edge technologies to make the world a better place!