PyInstaller

Bundle a Python application and all its dependencies into a single standalone package or executable.

Tool
PyPI
v6.22.2
13,070stars
GPL-2.0-or-later WITH Bootloader-exception

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
92/100Excellent
Development Activity100
Maintenance84
Community84
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
84/100Excellent
Architecture85
Code Quality82
Innovation84
Learning Curve78

PyInstaller freezes Python programs into stand-alone executables that run on Windows, macOS, and Linux without requiring the end user to install Python or any packages. It analyzes your script to discover every module, shared library, and data file it needs, then collects them — along with an embedded Python interpreter — into a single folder or a one-file executable.

Because it understands the import graph of real-world code, PyInstaller works with a huge range of third-party libraries out of the box and ships hundreds of community-maintained hooks for packages that need special handling. It is one of the most widely used ways to distribute Python desktop apps, CLI tools, and scientific software to users who neither have nor want a Python environment.

What You Get

  • A pyinstaller CLI that turns a script into a one-folder or one-file distribution
  • Automatic dependency analysis that traces imports, binaries, and data files
  • Hundreds of bundled hooks for popular packages (NumPy, PyQt, Django, and more)
  • Cross-platform support for Windows, macOS, and Linux (build on each target OS)
  • .spec files for reproducible, fully customizable build configuration

Common Use Cases

  • Shipping a Python desktop or GUI application to users without a Python install
  • Distributing an internal CLI tool as a single executable
  • Packaging data-science or automation scripts for non-technical end users
  • Producing self-contained builds in CI for release artifacts

Under The Hood

Architecture — PyInstaller runs in two conceptual stages. An analysis phase (driven by PyInstaller.building.build_main.Analysis) walks the module graph starting from your entry script, resolving imports, C-extensions, dynamic libraries, and data files, and applying per-package hooks under PyInstaller/hooks/ to handle libraries that defeat static analysis. A build phase then assembles the collected files into a one-folder or one-file distribution, prepending a compiled C bootloader that, at runtime, unpacks the archive (for one-file builds) and starts the embedded interpreter.

Tech Stack — The bulk of the toolchain is Python, with a C bootloader (built via a waf-based build under bootloader/) that is the small native launcher embedded into every produced executable. It supports Windows, macOS, and Linux, each with platform-specific packaging logic.

Code Quality — A mature, heavily tested project: an extensive test suite lives under tests/, the hook ecosystem is community-maintained and continuously updated, and the codebase is organized into clear subpackages (building, depend, hooks, utils). The GPL-with-bootloader-exception licensing is carefully documented.

API Design — Primarily a CLI (pyinstaller yourscript.py) with a rich flag set (--onefile, --windowed, --add-data, and more) plus .spec files for reproducible, programmable builds. Getting a first build is trivial; the learning curve appears mainly when tuning hooks and data inclusion for complex dependencies.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search