pex
The PEX packaging toolchain.
What it is and what it does
Pex is a command-line tool and library for building .pex files—self-contained, executable Python environments that function as portable binaries. Rather than shipping a virtualenv or requiring installation on the target system, pex bundles dependencies into a single executable file that runs without additional setup. The tool supports specifying dependencies, entry points, and platform-specific Python distributions, enabling cross-platform portability.
Pex is used to freeze dependencies into portable executables for application deployment, create standalone CLI tools, or integrate into build systems like Pants and Buck. It eliminates the need to manage virtualenvs on target machines and provides a simple distribution mechanism for Python applications.
Use it for:
- Deploy a Python web service as a single executable file without requiring virtualenv or pip on the target server.
- Create a standalone CLI tool that bundles all dependencies and runs on Linux or macOS systems.
- Freeze a development environment into a reproducible .pex file for consistent testing across machines.
- Build entry-point-based executables as self-contained binaries for distribution.
- Run ephemeral scripts with specific dependencies without modifying the host environment.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pex generates standalone, executable Python environments (.pex files) that bundle dependencies into portable binaries for deployment without virtualenv setup.
Yes. Pex is actively maintained with a release 1 day ago, has zero known vulnerabilities, and low install friction. It solves a real deployment problem by turning projects into portable, dependency-bundled executables. Well-suited for teams shipping applications or tools that need to run on multiple systems. The Apache-2.0 permissive license poses no restrictions.
Install
pex on PyPI
pip
pip install pexuv
uv add pexpoetry
poetry add pexInstalling pex
Before you install
Low install friction with no runtime dependencies. Active maintenance with a release 1 day ago and 4220 repository stars. Supports modern versions including PyPy.
License in practice
Apache-2.0 permissive license allows use in commercial and proprietary projects with minimal restrictions.
Quickstart
$ pip install pex
$ pex requests flask -o myapp.pex
$ ./myapp.pex
Verify before relying
- Whether .pex files built on one OS reliably execute on different OS targets without rebuilding
- Performance overhead of .pex startup compared to traditional virtualenv execution
- Compatibility guarantees across the full range of supported Python versions (2.7 through 3.15)
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,<3.16,>=2.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,582,503/month — #1,885 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pex-2.100.4-py2.py35.py36.py37.py38.py39.py310.py311-none-any.whl; pex-2.100.4-py3.py312-none-any.whl
Keywords: package, executable, virtualenv, lock, freeze
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
cx-Freezecx_Freeze converts Python scripts into…
permissive · top 15,000 on PyPI
shivshiv builds self-contained Python zipapps (PEP…
permissive · top 15,000 on PyPI
pyinstallerPyInstaller bundles a Python application and…
copyleft · top 5,000 on PyPI
pefilepefile reads and parses Portable Executable…
permissive · top 5,000 on PyPI
pickleyInstalls and auto-upgrades standalone Python…
permissive · top 15,000 on PyPI
relenvRelenv builds self-contained, reproducible…
unclear · top 15,000 on PyPI
pipenvPipenv automates Python virtual environment…
permissive · top 1,000 on PyPI
pip-chillpip-chill generates a minimal requirements file…
copyleft · top 15,000 on PyPI
venv-packVenv-pack packages Python virtual environments…
permissive · top 15,000 on PyPI
freeze-corefreeze-core provides core runtime support for…
permissive · top 15,000 on PyPI