UV for python environment management
Why I decided to look into UV?
Why UV Matters?
1. One Tool to Rule Them All
Maintaining multiple Python versions, installing developer tools, and managing dependencies is complicated. Traditionally, you might juggle between pyenv, pipx, and Homebrew. UV simplifies this by letting you install multiple Python versions and all your favorite tools through one command-line interface. Fewer tools to learn means less overhead for new developers.
2. Faster, Cleaner, and More Flexible
UV boasts some performance advantages over other package and environment managers—especially on installation and dependency resolution. While speed might not always be the deciding factor, the added efficiency is a welcome bonus, particularly in continuous integration (CI) environments or big projects that have to install dependencies often. With UV, you can also remove or avoid bloated development dependencies in your projects by running tools in isolated environments.
3. Future-Proof and Open
UV is funded by a VC-backed company (Astral), but its creators emphasize that it’s “forkable and maintainable.” Even if something changes down the road, the community can keep reaping the benefits. UV is also part of a greater push to provide an all-in-one developer experience for Python, similar to what Rust or Node provides—meaning the community as a whole is likely to benefit from its innovations.
Getting Started with UV
1. Installing UV
A simple script fetches the latest version for you:
bash
curl -LsSf https://astral.sh/uv/install.sh | shThis places uv and uvx on your system (typically in ~/.cargo/bin).
2. Managing Python Versions
Installing different Python versions can be done with:
bash
uv python install 3.8
uv python install 3.13You can then create aliases so that each version is available by name, for example:
bash
alias python3.8='uv run --python=3.8 python3'
alias python3='uv run --python=3.13 python3'This lets you call python3.8 or python3 directly for your desired Python version.
3. Installing and Running Tools
Using uvx
uvx is the quickest way to run a tool without permanently installing it. For instance:
bash
uvx ruff checkThis command downloads and runs ruff on the fly in an isolated environment. You can also specify versions, extras, or alternative package sources:
bash
uvx --from 'ruff>0.2.0,<0.3.0' ruff checkor
bash
uvx --from git+https://github.com/httpie/cli@master httpieGood to Know: If you need the tool to interact with your installed project code, particularly for test runners like pytest or mypy, use uv run instead of uvx.
Using uv tool install
If you plan to use a tool regularly (e.g., ruff, poetry, or mkdocs), you can install it persistently:
bash
uv tool install ruff
uv tool install mkdocs --with mkdocs-materialUV places these tools in a directory on your PATH, so you can call ruff or mkdocs directly without repeating uvx. You can upgrade or reinstall these tools using:
bash
uv tool upgrade ruff
uv tool install 'ruff>=0.4'Things UV Can Do for You
Manage Multiple Python Versions with Ease
From Python 3.8 to 3.13, UV lets you quickly install and switch among versions—no more fiddling with separate commands or environment variables.
Set Up a Complete Development Environment
By installing tools like, you can recreate your entire dev environment on a fresh machine with minimal steps. This is ideal for workshops or new developers on your team: “Download one binary, install what you need, and you’re up and running!”
Improve CI/CD Speed and Simplify Project Dependencies
UV is especially helpful in continuous integration environments where you often need a fast and clean environment. You can also reduce your project’s dev-dependency clutter by using uvx to call external tools instead of installing them in every environment.
Experiment with Version Constraints and Alternative Sources
Want to test an experimental feature in httpie from a Git branch? Or try out different versions of mypy? UV supports flexible version ranges and advanced --from syntax for installing from PyPI, GitHub repos, or pinned commits—something especially useful for advanced Python packaging or open-source experimentation.
Keep Your System Tidy
UV’s approach keeps tools’ dependencies separate from your main project’s dependencies. You won’t accidentally break your global environment or run into version conflicts. Everything is well-contained and easy to update or remove.
To sum up
UV stands out as a powerful, all-in-one solution for Python developers—newbies and veterans alike. Whether you’re installing multiple Python versions, managing common developer tools, or shaving seconds off your CI pipelines, UV gives you a clean and consistent experience.
It unifies environment management, is faster, and fosters an open ecosystem.
Simple installation script, easy Python version toggles, single commands for installing or running tools, and flexible version constraints.
A single tool that can manage your entire development setup—Python versions, tool installations, project dependencies, and more.
If you’re just getting started in Python, UV is a great way to simplify your workflow. If you’re a seasoned developer, you may find that it replaces a patchwork of other tools and saves you time. Try it out and see how it feels to have everything under one sleek command-line umbrella!
