Interview Prep/Python for DevOps/Environments, dependencies & packaging

What are `pipx` and `uv`, and when do you use them?

IntermediateConceptEnvironments, dependencies & packaging
Answer
  • pipx installs Python CLI applications (ansible-core, awscli-local, cookiecutter, pre-commit) each into its own venv and puts the executable on PATH. No dependency clashes, no system pollution.
  • uv (from Astral) is a Rust-based replacement for pip, pip-tools, venv, pipx and pyenv. It resolves and installs much faster, supports uv venv, uv pip install, uv lock, uv run, uvx <tool> and can install Python versions itself.

In CI, uv often cuts dependency install time from minutes to seconds, which is why many teams have moved to it.

All Python for DevOps questions Roadmap: Python for automation

More on Environments, dependencies & packaging