Skip to content

pipx: Install Python CLI Tools in Isolation

pipx is a command-line tool that installs and runs Python command-line applications in isolated environments. Each installed application gets its own virtual environment, preventing dependency conflicts between tools while making executables available on PATH.

Key features

  • One venv per tool. Every installation lives in its own virtual environment under $PIPX_HOME/venvs/<name>, so dependencies never collide across tools.
  • Ephemeral runs. pipx run <tool> builds a cached venv on first use and reuses it for 14 idle days before garbage-collecting it.
  • In-place dependency edits. pipx inject <venv> <package> adds a package to an existing tool’s environment without rebuilding; pipx uninject removes it.
  • Parallel installs of the same tool. pipx install --suffix=2 ruff keeps a second copy alongside the existing one, exposed on PATH as ruff2. The --suffix flag is marked experimental in pipx 1.7.
  • System-wide install mode. pipx install --global and the PIPX_GLOBAL_* variables install tools for every user on a machine instead of the current user.
  • Migration support. pipx list --json > snap.json followed by pipx install-all snap.json rebuilds every venv on a new machine or Python version.
  • Optional uv backend. pipx install pipx[uv] switches the venv-creation step to uv for faster installs while keeping the pipx CLI unchanged.
  • Man-page integration. Tool man pages are symlinked under $PIPX_MAN_DIR so man <tool> works after install.

Usage

pipx install ruff                   # install a tool
pipx run cowsay hello               # run a tool without installing
pipx upgrade ruff                   # upgrade an installed tool
pipx inject mkdocs mkdocs-material  # add a dep to an existing tool's venv
pipx list                           # list installed tools

For example, pipx install csvkit installs the csvkit suite of command-line tools in an isolated environment and makes its tools available on PATH.

pipx is distinct from pip; it uses pip internally to install packages into isolated environments rather than into the global Python environment.

Relationship to uv

pipx and uv’s uv tool subcommand (alias uvx) cover the same role: installing standalone Python CLI tools into per-tool venvs. uv is faster, manages Python versions in the same binary, and ships in a single install. pipx still owns inject, --suffix, --global, install-all, and man-page integration. See How do uv tool and pipx compare? for the full breakdown.

Learn More

Last updated on