pipx
pipx is a command-line tool that installs and runs end-user Python applications in isolated virtual environments and exposes their console scripts on your PATH. It targets packages that expose console scripts rather than libraries that other code imports.
Installation and Setup
Install it from PyPI and add it to PATH:
The official install guide uses brew install pipx on macOS and scoop install pipx on Windows. On distributions that adopt PEP 668, such as Ubuntu 23.04+, Debian 12+, and Fedora 38+, the system Python is externally managed and installing pipx with pip fails with externally-managed-environment. Those systems install the distribution package with sudo apt install pipx or sudo dnf install pipx.
Restart your shell so the PATH changes take effect.
Key Features
- Per-app isolation by creating one environment for each installed tool to avoid dependency conflicts.
- One-off execution with
pipx runto try a tool without installing it permanently, including local, URL-hosted, or VCS-hosted.pyscripts that declare their own dependencies in a PEP 723# /// scriptblock. - Flexible installation from PyPI, local paths, or version control systems (VCS), including extras and exact versions.
- Environment management commands to list, upgrade, reinstall, pin, and uninstall apps, plus inject to add extra packages to an app’s environment.
- Control over the interpreter used for an app with
--python, which helps test tools across Python versions, plus--fetch-python=missing|alwaysto download a standalone build when no local interpreter fits. - Pluggable backend that lets pipx build environments with uv instead of pip and
venv, chosen with--backend uvorPIPX_DEFAULT_BACKEND, while the CLI surface stays the same.
Usage
Install a command-line tool and expose its entry points:
$ pipx install black
Run a tool once without a permanent install:
$ pipx run pycowsay "Hello, World!"
Choose the interpreter for an app:
$ pipx install --python 3.14 nox
Install from a VCS URL or from a local project directory:
$ pipx install "git+https://github.com/psf/black"
$ pipx install .
Upgrade or remove tools and inspect what is installed:
$ pipx upgrade --all
$ pipx uninstall black
$ pipx list
Add an extra helper inside an app’s environment:
$ pipx inject black mypy
Related Resources
Tutorial
Install and Execute Python Applications Using pipx
In this tutorial, you'll learn about a tool called pipx, which lets you conveniently install and run Python packages as standalone command-line applications in isolated environments. In a way, pipx turns the Python Package Index (PyPI) into an app marketplace for Python programmers.
For additional information on related topics, take a look at the following resources:
- Python Virtual Environments: A Primer (Tutorial)
- A Beginner's Guide to pip (Course)
- Working With Python Virtual Environments (Course)
- Python Basics: Installing Packages With pip (Course)
- uv vs pip: Managing Python Packages and Dependencies (Tutorial)
- How to Publish an Open-Source Python Package to PyPI (Tutorial)
- Publishing Python Packages to PyPI (Course)
- Install and Execute Python Applications Using pipx (Quiz)
- Python Virtual Environments: A Primer (Quiz)
- uv vs pip: Python Packaging and Dependency Management (Course)
- uv vs pip: Managing Python Packages and Dependencies (Quiz)
- How to Publish Your Own Python Package to PyPI (Course)
- How to Publish an Open-Source Python Package to PyPI (Quiz)
Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials.
By Leodanis Pozo Ramos • Updated Sept. 13, 2026