A 2026 release that still declares support for Python 2.7
A tool for generating .pex (Python EXecutable) files, lock files and venvs.
At a glance
- What is it?
- pex packages a Python application and its dependencies into a single executable file, and the readme teaches it in six commands rather than in prose. Underneath, the packaging is unusually strange for a current release: the manifest declares support from 2.7 to 3.16, the declarative metadata deliberately lives in the older file so the old interpreters can still install it, and the project builds its own distributions with its own build backend, which needs a modern tool to run.
- Who is it for?
- pex is the right tool when you need a build artifact you can copy to a machine and run. Two things to check.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 9 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.
Star history
- pex-tool/pex4,226 ★ · +2
| Repository | 2026-09-23 | 2026-11-22 |
|---|---|---|
| pex-tool/pex | 4.2k | 4.2k |
2 Stars in the last 60 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The front page is reStructuredText and teaches in six commands
The repository's readme is not a Markdown file. It is a reStructuredText document, complete with an image directive for the build badge, a contents directive, and code-block directives with indented bodies rather than fenced ones.
The overview is short. The tool generates files with a particular extension that are executable Python environments, in the spirit of the tool most Python developers already use for isolated environments, described as an expansion on the ideas in a numbered Python enhancement proposal. The stated goal is that deploying an application becomes as simple as copying a file, and the files may include more than one platform's Python distribution so a single file can run on more than one operating system.
After that the page hands over to examples rather than prose. There is a link to a short conference talk for anyone still unsure, a link to the documentation site, and then six commands, each demonstrating one capability: an interpreter with packages in it, a frozen environment saved to a file, a throwaway environment for a single script, the same with an explicit entry point, a standalone executable for a console script, and the same interpreter-specific build targeting a second implementation of Python.
The examples close by pointing at the tool's own help output for the full option list.
An interpreter, a frozen environment, and a console script
The examples are worth reading as three distinct shapes rather than six variations.
The first launches an interpreter with three packages already in it, and one of the three is given as a version range rather than a bare name:
$ pex requests flask 'psutil>2,<3'The second takes the environment you already have, freezes it and writes it to a file you can carry somewhere else:
$ pex $(pip freeze) -o my_virtualenv.pex
$ deactivate
$ ./my_virtualenv.pexThe three lines are the demonstration: build, destroy the original environment, run the file. The prose above them mentions freezing via a requirements file, which the command does not actually use, since it takes the output of a freeze command directly.
The third shape builds a standalone executable for a declared console script rather than an environment you enter:
$ pex "pex>=2.1.35" --console-script pex-tools --output-file pex-tools-executable.pexand then the same thing targeting a specific interpreter, using the short form of the console-script flag:
$ pex "pex>=2.1.35" -c pex-tools --python=pypy -o pex-tools-pypy-executable.pexThe command is building the tool with itself, which is either a nice demonstration or a warning about how much of the ecosystem is built this way.
The install section recommends building pex with pex
There are two ways in, and the second is the interesting one.
The first is one command into your current environment:
$ pip install pexThe second builds the tool from a clone into a single file and copies that file onto your search path:
$ uv run dev-cmd package
$ cp dist/pex ~/binThe readme gives the reason, and it is a philosophical one rather than a practical one. The advantage of that approach is said to be that it keeps your Python environment as empty as possible, which is described as being more in line with what the tool itself does.
That is a coherent argument. A tool whose entire premise is that you should not need a populated environment should not ask you to populate one to install it. The cost is that the second route needs a modern package and lock tool installed first, and it runs a development command from the clone rather than a published artefact.
Both routes then converge: either way you end up with one executable, and the copy step is explicit rather than a package manager's business.
Support declared from 2.7 to 3.15 in a current release
The manifest's interpreter range is the first thing worth reading twice:
requires-python = ">=2.7,<3.17,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*"A lower bound of 2.7, an upper bound of 3.16, and an explicit exclusion of the 3.0 to 3.4 branches.
The comment above the build configuration explains why the modern metadata table is not used for everything. Declarative metadata in a pyproject file arrived in a setuptools version that itself requires 3.7 or newer, so to keep installability on 2.7, 3.5 and 3.6 the project keeps its declarative metadata in the older configuration file and generates the modern table only when a condition is met:
when = "python_version >= '3.9'"That condition exists because the project's own packaging command runs under it, which is how the distributions it builds get modern metadata even where it conflicts with older tooling.
The test suite has kept up with the range. The readme's example of running a subset of the tests names a Python 3.7 integration target:
$ uvrc test-py37-integration -- -k test_reproducible_buildwhich is a small sign that older versions are still exercised rather than merely declared.
The project builds its own distributions with its own backend
The build configuration points at a directory inside the repository:
backend-path = ["build-backend", ""]
build-backend = "pex_build.setuptools.build"That backend delegates the real work to setuptools and enables its own plugin, so packaging a pex file is part of building pex. The build also requires the modern lock tool as a dependency, which is how the build can shell out to it rather than shelling out to nothing.
The build configuration also defines a script-lock command run by the same tool with a long argument list: frozen, in a standard lock format, no header, no project emission, all extras, no development group, quiet.
The older setup script is still there too, and it does something worth noting. It creates a unique temporary build directory, registers a cleanup with the interpreter's exit hook, and passes that unique directory as the base for three different setup commands. The comment above those options says why: the default build directory for all three is the current working directory, which defeats concurrency in the test suite.
So a tool that makes concurrent, isolated environments for other people spends its own build system working around a shared directory.
Two alias scripts, one grammar slip, and a first person
The development section recommends a shell alias, because the command to run a single named task is long. It then says that an alias is recommended and that a particular one is the standard, and switches to writing the rest of the section using it.
Three small things happen in those two sentences. The readme writes "An shell alias", using "An" before a word that takes "A". It moves into the first person in a document that is otherwise written about the tool in the third. And it commits to a convention. The repository root also holds two shell scripts, duvrc.sh and duvrc-old.sh.
It is worth mentioning because of what it signals about the rest of the page. A readme written quickly by one person is more likely to contain a sentence like this, and that is a fair signal about how much weight to put on the polish of the documentation as opposed to the code.
Frozen platform names in a portability claim
The overview promises that a single file can be portable across two named operating systems, one of which is written with the name its vendor retired years ago. The sentence has not been revisited, and it sits in a project whose release line is at 2.107 and whose branch was pushed on 2026-11-02.
That is the most visible dated thing on the page. The rest is quieter: the portability mechanism itself is real and is described precisely, since a file may contain more than one platform's Python distribution rather than one.
The overview names three build systems that can produce the same artefact directly. One of them, Buck, is linked on a facebook.github.io page rather than on a domain of its own. Whether any of them is still a sensible choice in 2026 is not something the page addresses.
What the page does do consistently is tell you where to look next: the documentation site for everything beyond the examples and the tool's own help for the options. The package metadata in setup.py also links a CHANGES.md changelog for what a given version changed.
That last one matters more than usual here, given how wide the declared interpreter range is.
Editorial conclusion
pex is the right tool when you need a build artifact you can copy to a machine and run. Two things to check. The declared interpreter range is extremely wide, from 2.7 upward, which means the metadata is maintained for compatibility with installations most people no longer have, so read the changelog before assuming a point release is safe for an old environment. And the front page is a reStructuredText file with a first-person aside and a stray grammar slip, which tells you the project is maintained by a person writing quickly rather than by a documentation process.
Frequently asked questions
Are PEX crimpers better than PEX clamps?
Those questions are about plumbing fittings and this repository is a Python packaging tool with no connection to them. It generates executable Python environment files, and says nothing about crimping tools, clamps or fittings.
What tool do you use for PEX a?
The repository documents a Python tool that shares the name. It installs with one command, or can be built from a clone into a single file that is copied onto your search path, and its full option list is printed by running it with a help flag.
Can I crimp PEX without a tool?
Not a subject this repository addresses. Everything the page documents concerns building and running self-contained Python environments, from freezing the current one into a file to running a single script in a throwaway environment.
What can I use instead of a PEX crimping tool?
For the Python tool the page names three build systems that can produce the same artefact directly instead of using its command line interface, and it documents building the tool itself with itself. It names no alternative to a crimping tool of any kind.
how to use pex
The readme demonstrates three shapes: launching an interpreter with packages already in it, freezing the environment you already have into a single file that runs anywhere, and building a standalone executable for a project's declared console script, with a variant that targets a specific interpreter implementation.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/pex-tool-pex)Star history chart for your README
[](https://hysenlabs.com/projects/pex-tool-pex)Was this useful?