pipx install: Usage, Options & Common CI Errors
pipx install puts a Python command-line app in its own isolated environment, on PATH.
pipx installs Python CLI tools (black, poetry, ansible) each in an isolated venv, avoiding dependency clashes. In CI the snags are PATH setup and the new externally-managed-environment guard.
What it does
pipx install <tool> creates a dedicated virtualenv for the tool and exposes its entry points on PATH (~/.local/bin). This isolates each CLI's dependencies - the right tool for installing applications, where plain pip into the system Python now errors on Debian/Ubuntu under PEP 668.
Common usage
pipx install poetry
pipx ensurepath # add ~/.local/bin to PATH
pipx install "ansible-core==2.17.*"
pipx install --force black # reinstall
pipx run cowsay hi # run without installingCommon errors in CI
"\"poetry\" not found" right after install means ~/.local/bin is not on PATH - run pipx ensurepath (and re-source the profile, or export PATH yourself in CI since ensurepath edits a profile a fresh step will not read). On modern Debian/Ubuntu, plain pip install gives "error: externally-managed-environment" - that is exactly the case pipx solves for CLIs. "No apps associated with package" means the package exposes no console_scripts entry point (it is a library, not a CLI).
Options
| Item | What it does |
|---|---|
| install <tool> | Install a CLI into an isolated venv |
| ensurepath | Add the pipx bin dir to PATH |
| --force | Reinstall over an existing install |
| run <tool> | Run a tool ephemerally (no install) |
| inject <tool> <pkg> | Add a dependency into a tool's venv |