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.
More on Environments, dependencies & packaging
What is a virtual environment and why do we always use one?BeginnerWhat does `error: externally-managed-environment` mean?Beginner`requirements.txt` vs `pyproject.toml`: what goes where?IntermediateWhy is `pip freeze > requirements.txt` not a great lock strategy?IntermediateWhat do version specifiers like `~=`, `==`, `>=,<` mean?BeginnerHow do you manage multiple Python versions on one machine?Intermediate