As a Python developer, you’ve probably encountered the challenge of sharing your applications with others who might not have Python installed on their systems. Fortunately, PyInstaller comes to the rescue! PyInstaller is a versatile tool that allows you to transform your Python scripts into standalone executables for various platforms. In this quickstart guide, we’ll walk you through the simple steps of installing PyInstaller and using it to package your Python program into a single executable file.

Step 1: Installing PyInstaller

Before we get started, make sure you have Python installed on your system. Then, open your terminal or command prompt and install PyInstaller using pip:

pip install pyinstaller

Step 2: Creating a Basic Executable

Once PyInstaller is installed, navigate to the directory containing your Python script and run the following command:


Replace with the name of your Python script. PyInstaller will analyze your script’s dependencies and generate a bundled version in a subdirectory called “dist.” This directory will contain the standalone executable file along with any additional files needed to run your program.

Step 3: Generating a Single Executable

By default, PyInstaller creates a directory containing various files for your program. If you prefer a single executable file for easy distribution, use the -F or --onefile option:

pyinstaller -F

The -F flag packs everything into a single executable, making it more convenient to share your application.

Step 4: Handling Additional Dependencies

In some cases, your Python script might rely on external packages that are not automatically detected by PyInstaller. If you encounter “ImportError” issues when running your executable, consider specifying additional paths for PyInstaller to search for dependencies:

pyinstaller -F --paths=<your_path>\Lib\site-packages

Replace <your_path> with the actual path to your site-packages directory. This ensures that PyInstaller includes all necessary packages when building the executable.

Step 5: Dealing with Specific Dependencies

Occasionally, you may face compatibility issues with certain package versions in the standalone executable. For example, if you encounter problems with the pynput library, you can specify a particular version during installation:

pip install pynput==1.6.8


PyInstaller is a valuable tool for transforming your Python applications into standalone executables, allowing you to share your creations easily with others. By following this quickstart guide, you can now package your Python programs effortlessly and distribute them without worrying about whether the recipient has Python or the required dependencies installed. Empower your projects with PyInstaller and simplify the process of sharing your Python creations with the world. Happy coding!