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.
What it is
pipx installs Python CLI applications (black, poetry, httpie, youtube-dl, ruff) into isolated virtual environments and adds their executables to your PATH. Each tool gets its own venv, so dependencies never conflict with each other or with your system Python. pipx is the Homebrew equivalent for Python CLI tools.
pipx is for any developer who uses Python CLI tools and wants clean isolation without manually creating virtual environments for each one.
The project is actively maintained with regular releases and a growing user community. Documentation covers common use cases, and the open-source nature means you can inspect the source code, contribute fixes, and adapt the tool to your specific requirements.
How it saves time or tokens
Installing CLI tools with pip install into your system Python mixes tool dependencies with project dependencies, causing version conflicts and broken installs. pipx eliminates this problem: each tool is isolated, upgradeable independently, and removable without side effects. No more 'pip broke my system Python' debugging sessions.
How to use
- Install pipx via pip or your system package manager.
- Run
pipx install <tool>to install any Python CLI application. - The tool is immediately available in your PATH.
Example
# Install pipx
brew install pipx # macOS
pip install --user pipx
pipx ensurepath # Add pipx bin to PATH
# Install Python CLI tools
pipx install black
pipx install poetry
pipx install httpie
pipx install ruff
pipx install youtube-dl
# Run a tool without installing
pipx run cowsay 'Hello from pipx'
# List installed tools
pipx list
# Upgrade all tools
pipx upgrade-all
Related on TokRepo
- AI Tools for Coding -- Developer environment tools
- Featured Workflows -- Top workflows on TokRepo
Common pitfalls
- After installing pipx, you must run
pipx ensurepathto add the pipx binary directory to your PATH. Skipping this step means installed tools are not found. - pipx is for CLI applications, not libraries. If you need to
importa package in your Python code, use pip in a project virtual environment instead. - Tools installed with pipx use the Python version that pipx itself was installed with. If you need a tool to run on a specific Python version, use
pipx install --python python3.12 <tool>.
Before adopting this tool, evaluate whether it fits your team's existing workflow. Read the official documentation thoroughly, and start with a small proof-of-concept rather than a full migration. Community forums, GitHub issues, and Stack Overflow are valuable resources when you encounter edge cases not covered in the documentation.
Frequently Asked Questions
pip installs packages into the current Python environment (system or venv). pipx creates a separate virtual environment for each CLI tool, preventing dependency conflicts. pip is for libraries; pipx is for applications.
Yes. Use pipx run <tool> to run a Python CLI tool in a temporary environment without installing it permanently. This is useful for one-off commands or trying out tools.
Yes. pipx works on Windows, macOS, and Linux. On Windows, install it via pip and run pipx ensurepath to add the binary directory to your system PATH.
Run pipx upgrade <tool> to upgrade a specific tool, or pipx upgrade-all to upgrade all installed tools at once. Each tool is upgraded independently in its own virtual environment.
Yes. Use pipx inject <tool> <dependency> to add extra packages to a tool's isolated environment. This is useful for plugins or optional dependencies that a CLI tool supports.
Citations (3)
- pipx GitHub— pipx installs Python CLI apps in isolated environments
- pipx Documentation— Each tool gets its own virtual environment
- PyPA— Python packaging tools
Related on TokRepo
Discussion
Related Assets
HumHub — Open-Source Enterprise Social Network
A flexible, open-source social networking platform built on Yii2 for creating private communities, intranets, and collaboration spaces within organizations.
Dolibarr — Open-Source ERP & CRM for Business Management
A modular open-source ERP and CRM application written in PHP for managing contacts, invoices, orders, inventory, accounting, and more from a single web interface.
PrestaShop — Open-Source PHP E-Commerce Platform
A widely adopted open-source e-commerce platform written in PHP with a rich module marketplace, multi-language support, and a strong European user base.