If you program in Python regularly, you probably know the routine: create a virtual environment with python -m venv, activate it, install dependencies with pip, and then discover that someone else on the team has different versions because there's no real requirements.lock.
That workflow is changing rapidly since uv appeared in the Python ecosystem.
What is uv
uv is a Python project management tool created by Astral, the same team that developed Ruff (the linter and formatter that replaced Black, Flake8, and isort). It's written in Rust and replaces pip, virtualenv, pip-tools, and, to a large extent, pyenv.
In a single tool you can:
- Install and manage Python versions
- Create virtual environments
- Install dependencies
- Generate and respect lock files (
uv.lock) - Run scripts with inline dependencies
How to install uv
On Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
On Linux or macOS:
curl -LsSf https://astral.sh/uv/install.sh | sh
That's it. You don't need Python preinstalled to start.
Advantage 1: It's extremely fast
uv can install dependencies up to 10-100 times faster than pip. This isn't marketing: the difference comes from being written in Rust and using an optimized dependency resolver that parallelizes downloads and installations.
On large projects with dozens of dependencies, the difference between pip install -r requirements.txt and uv sync goes from several minutes to a few seconds.
Advantage 2: It manages Python, not just packages
With uv you can install specific Python versions without depending on your operating system's package manager:
uv python install 3.12
uv python install 3.11 3.10
Then switch between them easily:
uv python pin 3.12
This eliminates the need for pyenv in most cases.
Advantage 3: Automatic virtual environments
uv creates and manages virtual environments without you having to think about them. When you start a project:
uv init my-project
cd my-project
uv add requests
uv automatically created a virtual environment in .venv/, installed requests and its dependencies, and updated pyproject.toml.
You don't need to remember source .venv/bin/activate or deactivate. uv run python executes your code inside the correct environment automatically.
Advantage 4: Deterministic dependency locking
This is perhaps the most important change for teams. When you run:
uv sync
uv generates a uv.lock file that records exactly which version of each package (and subdependency) is installed, with verification hashes.
When another developer clones the repository and runs uv sync, they get exactly the same versions. No more "it works on my machine".
Advantage 5: Scripts with inline dependencies
You can write a Python script with its dependencies declared at the top:
# /// script
# dependencies = ["requests", "pandas"]
# ///
import requests
import pandas as pd
# your code here
Then run:
uv run script.py
uv automatically installs requests and pandas in a temporary environment, runs the script, and cleans up afterward. You don't need to create a full project for a 50-line script.
Advantage 6: Full compatibility with the existing ecosystem
uv doesn't force you to change everything immediately. It can:
- Read and install from
requirements.txt - Read and generate
pyproject.tomlwith PEP 621 standard - Install packages in environments created with
venv - Work with
setup.pyandsetup.cfg
This means you can adopt uv gradually in existing projects without rewriting configurations.
Advantage 7: One tool instead of four
Before you needed:
pyenvto manage Python versionsvirtualenvorvenvfor virtual environmentspipto install packagespip-toolsto lock dependencies
Now uv does all of that with consistent commands and unified documentation. Fewer tools means fewer points of failure and less time configuring your development environment.
Migration from pip: how much does it cost
For most personal projects, migration takes less than 10 minutes:
- Install
uv - Run
uv pip install -r requirements.txtif you want to keep using the old format - Or run
uv initin a new project and start withpyproject.toml
The learning curve is almost flat because the commands are intuitive: uv add, uv remove, uv run, uv sync.
Should you switch to uv?
If you work alone on small scripts and rarely manage complex dependencies, the difference won't be dramatic. But if you:
- Work in a team
- Manage projects with many dependencies
- Spend time resolving version conflicts
- Need to reproduce exact environments in production
Then uv isn't just an alternative to pip. It's an objective improvement in speed, reliability, and simplicity.
Learning Python with the tools of the future
At Crezendo we teach Python from scratch, and one of the first lessons we give is how to manage your professional work environment. We don't teach obsolete workflows: our students learn to use modern tools like uv, Ruff, and Git from day one.
If you're starting to program or want to update your skills, having a well-configured development environment makes the difference between frustration and productivity. And if you don't have a computer to practice, write to us. Through donations of used equipment, we put restored laptops in the hands of people who want to learn exactly this.
The right tool doesn't make you a better programmer by itself, but it eliminates the friction that prevents you from focusing on what really matters: solving problems with code.