PyApp: Ship Python Apps as Self-Bootstrapping Binaries
Ever tried sharing a Python script with someone who doesn't have Python installed? You end up explaining pip install, virtual environments, and why Python 3.9 matters. It's a pain.
PyApp solves that. It wraps your Python application in a binary that bootstraps itself at runtime — no Python installation required on the user's machine.
What It Does
PyApp takes your Python project (a script, a module, or a package) and packages it into a single, standalone binary. When you run that binary, PyApp:
- Checks if Python is already available. If not, it downloads a portable, self-contained Python runtime (CPython, PyPy, or even GraalPy) into a cache directory.
- Installs your app's dependencies from PyPI or a local wheelhouse.
- Runs your app.
The environment is isolated per app. No global Python pollution, no dependency conflicts.
Why It’s Cool
No Runtime Hassles
Your users don't need Python. PyApp handles everything — downloading the right interpreter, resolving dependencies, and caching it all for subsequent runs.
Multi-Platform
Works on Windows, macOS, and Linux. Your binary is just one file. No .dmg, no .exe, no .AppImage. One binary, all platforms.
Smart Cache
PyApp caches the extracted Python runtime and dependencies. After the first run, startup is nearly instant. It uses platform-specific cache directories (e.g., ~/.cache/pyapp on Linux), so it's clean and respectful of system resources.
Extensible
You can write custom bootstrapping logic. Want to pull dependencies from an internal PyPI mirror? Want to verify checksums? You can hook into the process with plugins.
No Pre-Bundling Overhead
Unlike PyInstaller or Nuitka, PyApp doesn't bundle Python into your binary at build time. That means your binary stays tiny (a few kilobytes). The runtime is downloaded on first launch — once per machine, shared across all PyApp apps.
How to Try It
Install PyApp globally (requires Python, but only for packaging):
pip install pyapp-packager
Then package your app:
pyapp build my_script.py
You'll get a my_script binary in the current directory. Send that to a friend without Python. It just works.
Or try the official demo:
# Install the demo binary
curl -sSL https://pyapp.sh/install | bash
# Run it
pyapp run https://github.com/ofek/pyapp/raw/main/demo/hello.py
You'll see PyApp download Python, install dependencies, and run the script — all from a single command.
Final Thoughts
PyApp isn't trying to replace PyInstaller or Nuitka. It's solving a different problem: making Python apps instantly runnable on machines without Python, without bloating your binaries or requiring complex build pipelines.
If you ship CLI tools, internal scripts, or open source projects used by non-Python devs, this is a game changer. It's also a great way to test your app in a clean environment — just delete the cache and run again.
One caveat: the first launch downloads a Python runtime, so it requires internet. But after that, it's cached locally. For offline machines, you can pre-download the runtime and bundle it.
Try it on your next side project. You might never pyinstaller again.
Follow us on X at @githubprojects for more developer tools and open source gems.