PyInstaller
Utility to bundle a Python application into a single package or executable file. Analyzes Python scripts to discover and include all required modules and libraries.
Description
PyInstaller reads a Python script, analyzes the code to discover every module and library needed for execution, collects copies of those files, and bundles them with the script into a single folder or executable file. This package provides the executables, depending on python3-pyinstaller for the Python modules. It is useful for distributing Python applications without requiring users to install Python or dependencies manually.
The tool includes several utilities like pyi-archive_viewer for viewing archive contents, pyi-bindepend for showing bind dependencies, pyi-grab_version for extracting version info from executables, pyi-makespec for generating spec files, and pyi-set_version for setting version information. These support various aspects of building, inspecting, and modifying bundled applications, particularly for Windows and macOS targets.
python3-pyinstaller provides the core Python modules, while the pyinstaller package contains the command-line executables. Installed size for pyinstaller is 104 KB and for python3-pyinstaller is 2.35 MB.
How It Works
PyInstaller analyzes the Python script to identify imports and dependencies, collects all required modules, libraries, and data files, then bundles them into a single folder (--onedir) or standalone executable (--onefile). For onefile mode, it extracts files to a temporary directory at runtime. Utilities like pyi-archive_viewer parse and list contents of PyInstaller archives, pyi-bindepend analyzes dynamic library dependencies, and pyi-makespec generates .spec files that control bundling options such as hidden imports, data collection, and platform-specific features like console handling or code signing.
Installation
sudo apt install pyinstallerFlags
Examples
pyi-archive_viewer -hpyi-bindepend -hpyi-grab_version -hpyi-makespec -hpyi-set_version -hpyinstaller -hsudo apt install pyinstaller