Skip to content

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:

Language: Windows PowerShell
PS> py -m pip install pipx
PS> py -m pipx ensurepath
PS> pipx --version
Language: Shell
$ python -m pip install pipx
$ python -m pipx ensurepath
$ pipx --version

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 run to try a tool without installing it permanently, including local, URL-hosted, or VCS-hosted .py scripts that declare their own dependencies in a PEP 723 # /// script block.
  • 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|always to 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 uv or PIPX_DEFAULT_BACKEND, while the CLI surface stays the same.

Usage

Install a command-line tool and expose its entry points:

Language: Shell
$ pipx install black

Run a tool once without a permanent install:

Language: Shell
$ pipx run pycowsay "Hello, World!"

Choose the interpreter for an app:

Language: Shell
$ pipx install --python 3.14 nox

Install from a VCS URL or from a local project directory:

Language: Shell
$ pipx install "git+https://github.com/psf/black"
$ pipx install .

Upgrade or remove tools and inspect what is installed:

Language: Shell
$ pipx upgrade --all
$ pipx uninstall black
$ pipx list

Add an extra helper inside an app’s environment:

Language: Shell
$ pipx inject black mypy
Install and Execute Python Applications Using pipx

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.

intermediate tools

For additional information on related topics, take a look at the following resources:

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