LIVEReading: Run Any Python CLI Tool Without Polluting Your SystemTotal time: 7 minSteps: 6Worked first time: 90% LIVEReading: Run Any Python CLI Tool Without Polluting Your SystemTotal time: 7 minSteps: 6Worked first time: 90%
CBW
Run Any Python CLI Tool Without Polluting Your System
Easygithub.com/pypa/pipx2026-07-10

Run Any Python CLI Tool Without Polluting Your System

pipx lets you install Python command-line tools in their own sandboxed environments so they never conflict with each other or your system. Think of it like a package manager just for Python apps.

// Build stats

  • Total time7 min
  • Number of steps6
  • DifficultyEasy
  • Worked first time90%
// Before you start

What you need

  • Python 3.8 or newer installed (type `python3 --version` to check)
  • pip available (comes with Python)
  • macOS, Linux, or Windows
  • Terminal / Command Prompt access
  • No coding knowledge required
01
Step 1 of 6

Install pipx on your machine

2 min

Pick the one command that matches your operating system. This installs pipx itself — the tool you will use to manage everything else. You only do this once.

Terminal · mac
$ # macOS:
$ brew install pipx
$
$ # Linux:
$ python3 -m pip install --user pipx
$
$ # Windows (requires Scoop — install Scoop first from https://scoop.sh):
$ scoop install pipx
What you should see
A success message from brew, pip, or scoop confirming pipx was installed.
This might happen

On Linux you see 'WARNING: The script pipx is installed in ... which is not on PATH'

That is fine — the next step fixes it automatically.

02
Step 2 of 6

Add pipx to your PATH

1 min

PATH is the list of folders your terminal searches when you type a command. This one command adds pipx's folder to that list so you can type `pipx` from anywhere. You then need to restart your terminal for the change to take effect.

Terminal · mac
$ pipx ensurepath
What you should see
A message like 'Success! Added /home/yourname/.local/bin to the PATH environment variable.' followed by instructions to restart your shell.
This might happen

After running ensurepath, `pipx` still says 'command not found'

Close your terminal completely and open a new one. The PATH change only applies to new sessions.

03
Step 3 of 6

Verify pipx is working

1 min

Before installing anything real, confirm pipx is set up correctly. This command prints the version number and a short help summary.

Terminal · mac
$ pipx --version
What you should see
A version number such as `1.4.3`.
04
Step 4 of 6

Install a Python app with pipx

2 min

This is the main thing pipx does. The example below installs `pycowsay`, a harmless demo tool. Replace `pycowsay` with any Python CLI tool you actually want — for example `black`, `httpie`, `yt-dlp`, or `poetry`. Each tool gets its own isolated environment so nothing ever conflicts.

Terminal · mac
$ pipx install pycowsay
What you should see
'pycowsay' installed successfully. You can now run it by typing `pycowsay`.
This might happen

Error: 'No apps associated with package pycowsay' or similar for a different package

Some Python packages are libraries, not CLI apps, and cannot be installed with pipx. pipx only works with packages that expose a command-line entry point.

05
Step 5 of 6

Run a tool once without installing it

1 min

Sometimes you just want to use a tool once without keeping it around. `pipx run` downloads it into a temporary environment, runs it, and then discards it. Nothing is left behind on your system.

Terminal · mac
$ pipx run pycowsay hello from pipx
What you should see
A small ASCII cow saying 'hello from pipx' printed in your terminal.
06
Step 6 of 6

List, upgrade, and uninstall apps

2 min

These three commands cover everyday maintenance. `list` shows everything you have installed. `upgrade-all` updates every app at once. `uninstall` removes a single app and its isolated environment completely — no leftover files.

Terminal · mac
$ # See all installed apps:
$ pipx list
$
$ # Upgrade every installed app:
$ pipx upgrade-all
$
$ # Remove one app:
$ pipx uninstall pycowsay
What you should see
`pipx list` prints a table of installed apps and their versions. `upgrade-all` prints upgrade status for each. `uninstall` confirms the app was removed.
// Status

cooked. baked. worked.

pipx is installed and on your PATH. You can install any Python CLI tool with one command, run tools temporarily without installing them, and cleanly uninstall anything — all without ever touching your system Python.

// the honest bit

The honest part

pipx only works with Python packages that ship a command-line entry point. It cannot install GUI apps or plain libraries. If a tool you want is not on PyPI (Python's package index), pipx cannot find it. Windows users need Scoop installed first, which is an extra step not covered here — visit https://scoop.sh for that.