pipx Cheat Sheet (2026 Edition)

pipx is a fantastic tool for installing and running Python command-line applications in isolated environments — without polluting your system Python or needing to activate virtual environments every time.

Think of it as:

  • brew / apt / choco but only for Python CLI tools
  • Like npx in the JavaScript world
Quick Summary – What pipx Solves
You want to...Normal way (messy)With pipx (clean)
Use black, poetry, httpie, yt-dlp, etc.pip install --user ... → global pollutionpipx install black → isolated + on PATH
Try a tool oncecreate venv, activate, installpipx run black ... (no install!)
Upgrade toolsremember which ones you havepipx upgrade-all

Most common & recommended methods in 2025–2026:

# Best / most maintained way
python3 -m pip install --user pipx
python3 -m pipx ensurepath

After the last command close and reopen your terminal (or run source ~/.bashrc / equivalent).

Alternative one-liners many people use:

# macOS / Linux (very popular)
brew install pipx    # if you have Homebrew

sudo apt install pipx          # Ubuntu 23.04+
sudo dnf install pipx          # Fedora
scoop install pipx             # Windows + Scoop
choco install pipx             # Windows + Chocolatey

CommandWhat it doesExample
pipx install PACKAGEInstall app + put binaries on PATHpipx install black
pipx run PACKAGERun once (temporary env — no install)pipx run cowsay hello
pipx run --spec GIT_URL ...Run directly from gitpipx run --spec git+https://github.com/...
pipx listShow all installed tools
pipx upgrade PACKAGEUpdate one toolpipx upgrade poetry
pipx upgrade-allUpdate everything
pipx uninstall PACKAGERemove tool + its isolated venv
pipx reinstall PACKAGEReinstall (useful after Python upgrade)
pipx inject PACKAGE EXTRAAdd extra package into existing tool's venvpipx inject black isort

# Install popular tools
pipx install poetry          # dependency management
pipx install black           # code formatter
pipx install ruff            # fast linter / formatter
pipx install httpie          # modern curl-like tool
pipx install yt-dlp          # youtube downloader
pipx install glances         # system monitor
pipx install commitizen      # conventional commits

# Run once without installing
pipx run speedtest-cli

# Try pre-release / git version
pipx install --force git+https://github.com/psf/black.git@main

# Upgrade everything once a month
pipx upgrade-all

  • Use pipx upgrade-all regularly — most Python CLI tools update frequently
  • If a tool needs extra dependencies (e.g. black + isort):
    pipx install black
    pipx inject black isort
  • After major system Python upgrade → run pipx reinstall-all
  • Want suffix so you know it's a Python tool?
    pipx install black --suffix=-py
    # → now you run black-py instead of black
  • Windows users: make sure ~/.local/bin (or equivalent) is on PATH

Official docs (very readable): https://pipx.pypa.io/stable/