# pipx — Install and Run Python CLI Apps in Isolated Environments > pipx installs Python CLI tools (black, poetry, httpie, youtube-dl) into isolated venvs and exposes their commands globally. It eliminates the mess of mixing app dependencies into your system Python. ## Install Save in your project root: # pipx — Install Python CLI Apps in Isolated Environments ## Quick Use ```bash # macOS brew install pipx # Any platform python -m pip install --user pipx && python -m pipx ensurepath pipx install httpie pipx install poetry pipx install black pipx list pipx upgrade-all ``` ## Introduction `pip install` into your system Python is how dependency hell starts. pipx solves it: each CLI tool lives in its own virtualenv, but the entry points are symlinked into a directory on your PATH. You get clean isolation with the convenience of "global" installs. With over 10,000 GitHub stars, pipx is now the officially recommended way to install Python CLIs — it is bundled with Debian, Ubuntu, Fedora, and Homebrew. ## What pipx Does pipx creates `~/.local/pipx/venvs/` for each installed app and symlinks their scripts into `~/.local/bin`. Tools stay isolated (they cannot break each other), are upgradable independently, and can be run once-off with `pipx run ` without any permanent install. ## Architecture Overview ``` pipx install black | [Create venv] ~/.local/pipx/venvs/black | [pip install black into venv] | [Expose entrypoints] ~/.local/bin/black --> venv/bin/black | Shell finds `black` on PATH pipx run cowsay "hi" (no install) | Temporary venv, cached by version, deleted after N days ``` ## Self-Hosting & Configuration ```bash pipx install --python python3.11 ansible pipx install "httpie[all]" pipx install git+https://github.com/user/mycli.git pipx install nox pipx inject nox nox-poetry pipx run --spec "cookiecutter==2.5.0" cookiecutter gh:audreyr/cookiecutter-pypackage pipx reinstall-all ``` ## Key Features - **Isolated venvs per app** — no dependency conflicts between tools - **Global-feeling commands** — scripts symlinked into PATH - **One-off runs** — `pipx run` caches and executes without permanent install - **Version pinning** — install specific versions or from git/PyPI/paths - **Inject plugins** — add deps to a tool's venv without touching the app - **Upgrade-all** — one command updates every installed tool - **Cross-platform** — macOS, Linux, Windows all first-class - **ensurepath** — auto-adds `~/.local/bin` to your shell PATH ## Comparison with Similar Tools | Feature | pipx | uv tool | pip --user | Homebrew | apt/pipy | |---|---|---|---|---|---| | Isolated per tool | Yes | Yes | No (shared) | Yes | Yes | | Python versioning | Yes | Yes | Limited | Limited | Fixed | | One-off run | Yes | Yes | No | No | No | | Speed | Good | Excellent | Fast | Moderate | Fast | | Non-Python tools | No | No | No | Yes | Yes | | Best For | Python CLIs | Python CLIs + speed | Quick installs | Native binaries | System packages | ## FAQ **Q: pipx vs `pip install --user`?** A: --user puts every tool's deps into one shared user site-packages — conflicts are inevitable. pipx isolates each tool in its own venv. Always prefer pipx. **Q: pipx vs uv tool — which is better?** A: `uv tool install` is dramatically faster (Rust-based). pipx is more established with wider distro packaging. Both do the same job. **Q: Does pipx work on Windows?** A: Yes. It installs `.exe` shims and `pipx ensurepath` handles PATH setup. **Q: Can I upgrade just one tool?** A: `pipx upgrade ` upgrades one; `pipx upgrade-all` upgrades everything. ## Sources - GitHub: https://github.com/pypa/pipx - Docs: https://pipx.pypa.io - Org: Python Packaging Authority (PyPA) - License: MIT --- Source: https://tokrepo.com/en/workflows/69c5d4ff-37b5-11f1-9bc6-00163e2b0d79 Author: AI Open Source