Posted inApps / Linux / Open Source

pipx: How to Install and Run Python Apps in Isolated Environments

Python logo alongside the pipx wordmark with a green X

pipx is a free and open source tool that allows you to install and run Python command line applications in isolated environments. In a way, it turns the Python Package Index (PyPI) into a big app store for Python applications.

It’s closely related to pip, but focuses on Python packages that can be run directly from the command line as applications.

Each application gets its own virtual environment, and pipx makes its executable available on your PATH. This helps prevent dependency conflicts and keeps application dependencies out of your system Python environment. Dependency isolation isn’t security sandboxing, though. Applications can still access the files and resources available to your account, so only install packages you trust.

How to install pipx

As of November 26, 2026, the latest stable release listed on PyPI is pipx 1.19.1, released November 23. It requires Python 3.11 or later. Older distribution packages can have different requirements. I’d start with your operating system’s package manager.

macOS

macOS users can install pipx via Homebrew:

brew install pipx
pipx ensurepath

Ubuntu and Debian

sudo apt update
sudo apt install pipx
pipx ensurepath

On Ubuntu the package is in Universe. If it’s unavailable on your distribution release, check the alternative installation method below.

Fedora

sudo dnf install pipx
pipx ensurepath

Arch Linux

On Arch Linux pipx is available in the official Extra repository:

sudo pacman -Syu python-pipx
pipx ensurepath

Windows

With a supported Python installation, Python launcher and pip available, open PowerShell or Command Prompt and run:

py -m pip install --user pipx
py -m pipx ensurepath

See the official installation instructions for additional options.

Fixing the externally managed environment error

When this article was originally published, installing pipx using python3 -m pip install --user pipx was a common recommendation. Today, a Python installation implementing PEP 668 may reject this command with an externally-managed-environment error. This protects Python environments managed by another package manager.

Use your operating system’s pipx package if possible. Alternatively, on Linux or macOS, install pipx itself inside a dedicated virtual environment:

python3 -m venv "$HOME/.venvs/pipx"
"$HOME/.venvs/pipx/bin/python" -m pip install pipx
"$HOME/.venvs/pipx/bin/pipx" ensurepath

You’ll need a supported Python version and venv functionality (on Debian and Ubuntu you may need python3-venv). Keep this environment intact and invoke pipx using its full path or add its bin directory to your PATH. Don’t bypass system Python protections with --break-system-packages or sudo pip install.

Configure PATH and verify your installation

pipx ensurepath makes the application executable directory available on your PATH so you can launch installed apps by name. Close and reopen your Terminal afterwards. Some shell configurations may require logging out and back in.

Terminal showing pipx ensurepath adding the local application directory to PATH

Check your installation:

pipx --version
pipx environment
pipx list

If pipx itself isn’t on PATH after a manual virtual environment installation, use its full path as above.

Installing pipx through a system package manager may require administrator privileges. Installing applications for your own account normally doesn’t. Recent pipx versions also support optional global installations on Unix systems, for example sudo pipx install --global PACKAGE. You don’t need this for ordinary personal use.

How to use pipx

Install and list applications

To install a Python application, run pipx install PACKAGE. For example:

pipx install pycowsay
pycowsay "FSMdotCOM"
pipx list

The original 2020 screenshots below use the older cowsay package. Current paths and output may differ.

Historical Terminal example installing cowsay with pipx, listing its environment and running the application

For a more practical example, try pipx install "yt-dlp[default]". See our guide to using yt-dlp with mpv for additional playback dependencies.

Run an application temporarily

pipx run pycowsay "Hello from FSMdotCOM"

pipx installs the package in a temporary environment and runs it. The environment may be cached for reuse, but the application isn’t added to your regular list of installed packages.

Historical Terminal example uninstalling cowsay, running it temporarily with pipx run and confirming that no permanent installation remains

Upgrade, reinstall and uninstall applications

To upgrade a package or all installed packages, respectively:

pipx upgrade pycowsay
pipx upgrade-all

To recreate an application’s environment, use pipx reinstall pycowsay. You can also use pipx reinstall-all to recreate all managed environments, which can be useful after a Python upgrade if pipx itself still works.

To uninstall an application:

pipx uninstall pycowsay

There’s also pipx uninstall-all, which removes all managed applications in the selected scope.

Add dependencies with pipx inject

Sometimes you want an optional plugin or library available inside an existing application’s environment. Instead of installing it in another environment, use pipx inject. For example, to make the requests library available inside the ptpython interactive Python shell:

pipx install ptpython
pipx inject ptpython requests
pipx list --include-injected

Where does pipx install applications?

Recent releases (after 1.16.0) use platform specific data directories. For new installations, the typical pipx home directories are:

  • Linux: ~/.local/share/pipx
  • macOS: ~/Library/Application Support/pipx
  • Windows: %LOCALAPPDATA%\pipx\pipx

Application environments live in the venvs subdirectory. Executables are normally exposed in ~/.local/bin (relative to your user home on each platform). Older versions may use ~/.local/pipx or other previous locations. Don’t assume an existing installation has migrated automatically. Run pipx environment to see the actual paths on your machine.

You can override these locations using PIPX_HOME and PIPX_BIN_DIR. Before moving an existing installation, consult the path configuration guide. Virtual environments can contain absolute paths and may need to be recreated.

pip vs pipx vs uv tool

Use pip for Python libraries and project dependencies, usually within a project’s virtual environment. Use pipx for standalone command line applications. The uv tool workflow also supports isolated application installation and temporary execution through uv tool install and uvx. If you’re already using uv, you don’t need to install the same application with both tools.

pipx is very well documented, so going into greater detail would be a matter of pointless copy and paste. You can learn more about it in the official documentation and on the project’s GitHub page. Also, don’t forget to run pipx --help.

Support FSMdotCOM on Liberapay