uv: The Extremely Fast Python Package and Project Manager

Python developers have spent years assembling a chain of separate utilities to do one job: set up a project, pick a Python version, create a virtual environment, install packages, lock their versions, and publish the result. Each link in that chain has its own commands, its own configuration file, and its own way of failing. uv, pronounced “you-vee”, sets out to replace the whole chain with a single fast tool. It is a Python package and project manager written in Rust by Astral, the team behind the Ruff linter and formatter, and it has quickly become one of the most talked-about tools in the Python ecosystem.

This guide explains what uv does, how to install it, and how to use it for everyday work: managing Python versions, starting projects, locking dependencies, running single-file scripts, and installing command-line tools. It also looks honestly at where uv fits, where it is fastest, and where another tool may still be the better choice. The examples use the current release, uv 0.13.13, which Astral published on 4 December 2026.

1. What uv Is and Why It Exists

uv logo
uv logo (Simple Icons, CC0)

uv is a single binary that covers the work previously spread across pip, pip-tools, pipx, Poetry, pyenv, twine, and virtualenv. Instead of learning seven tools, you learn one command with consistent subcommands. It creates virtual environments, resolves and installs dependencies, locks them for reproducible builds, manages Python interpreters, runs scripts, and can even build and publish packages.

The project began as a faster replacement for pip and pip-tools. Astral announced uv in February 2024, and its scope has grown steadily since then, from package installation to full project and workspace management. The stated ambition is to provide for Python what Cargo provides for Rust: one coherent workflow from the first file to a published package.

Speed is the headline feature. The official documentation describes uv as 10 to 100 times faster than pip, and Astral reported even larger gains for warm-cache installs in its original announcement. The reasons are practical rather than magical: uv is written in Rust, it resolves dependencies in parallel, it downloads packages concurrently, and it reuses a global cache so a package already on your machine is never downloaded twice. For a developer who installs dependencies every day, that difference is felt immediately, in shorter waits and in a workflow that no longer discourages fresh environments.

There is a second, quieter benefit: fewer moving parts. Because one tool owns the environment, the lockfile, and the interpreter, there are fewer mismatches between them. A project that works on your laptop is more likely to work on a colleague’s machine and in continuous integration, because the same commands produce the same environment in each place.

2. Installing uv

One of the pleasant surprises about uv is that you do not need Python installed to install it. uv ships as a standalone binary, so the installer can set it up on a clean machine, and uv can then download and manage Python versions for you.

On macOS and Linux, the recommended installer is a short shell command:

curl -LsSf https://astral.sh/uv/install.sh | sh

On Windows, the equivalent installer runs in PowerShell:

irm https://astral.sh/uv/install.ps1 | iex

If you prefer your system package manager, uv is available through the usual channels. You can install it with pip, with Homebrew on macOS, or with winget on Windows:

pip install uv
brew install uv
winget install astral-sh.uv

After installation, check that uv is on your path and see which version you have:

uv --version
uv self update

The second command updates uv itself, which is worth running regularly. uv is under active development, with frequent releases, so keeping it current is the easiest way to pick up new commands and fixes. If you installed uv through a package manager, update it through that same manager instead.

3. Managing Python Versions with uv

Many Python frustrations begin before any code is written: the system Python is too old, the project needs a newer release, and the version a colleague uses is different again. uv manages Python interpreters directly, so each project can state the version it needs and uv will provide it.

To see the versions available on your machine, and to install a new one, use the uv python family of commands:

uv python list
uv python install 3.13
uv python install 3.12 3.13

These commands download prebuilt Python builds and keep them in a managed directory, separate from your system Python. Nothing about the system interpreter changes, which keeps the setup safe to try and easy to undo.

Once a version is installed, you can ask uv where it lives, or pin a project to it:

uv python find
uv python pin 3.13

The pin command records the chosen version in a .python-version file in the project, so everyone who opens the project gets the same interpreter. Commands such as uv run read that file automatically and use the pinned version, or download it if it is missing. A version you no longer need can be removed with uv python uninstall, which keeps the managed directory tidy without touching the system Python.

This approach removes a whole category of setup instructions from project documentation. Instead of telling a new contributor to install a particular Python release through their operating system, you can tell them to install uv and let the project declare the version it needs.

4. Projects and the Universal Lockfile

A uv project is a directory with a pyproject.toml file that describes the project and its dependencies. Starting one takes a single command:

uv init my-project
cd my-project

By default, uv init creates a small project with a pyproject.toml, a starter main.py, and a readme. You can add a dependency with uv add, which updates pyproject.toml, resolves the full dependency tree, and writes the result to a lockfile called uv.lock:

uv add requests
uv add --dev pytest
uv remove requests

The lockfile is the heart of reproducible builds in uv. While pyproject.toml records the ranges you accept, such as “requests version 2 or later”, uv.lock records the exact version of every package that was chosen, for every platform the project supports. That lockfile is universal: one file covers macOS, Linux, and Windows, and all the Python versions the project declares, so a lock made on one machine applies on the others.

To recreate the locked environment, a teammate runs uv sync, which creates the virtual environment if needed and installs exactly the locked versions. Running the project is just as direct:

uv sync
uv run main.py
uv lock --check

The last command verifies that the lockfile is up to date with pyproject.toml, which is a useful check in continuous integration. You can also inspect the resolved tree at any time with uv tree, which prints dependencies in a readable nested list. For a Python data project, for example, this workflow keeps experiment code and its dependencies in step; if you work with machine learning libraries, the same discipline helps when you follow a guide such as Using the Transformers Library: The Complete Guide in 9 Chapters, where matching library versions across machines matters.

5. Running Single-File Scripts

Not every Python program is a project. Sometimes you want a single script that you can share, run, and forget, without creating a directory, a virtual environment, and a configuration file for it. uv supports that style through scripts with inline dependency metadata, defined by PEP 723.

A script declares its dependencies in a comment block at the top of the file. Here is a small example:

# /// script
# requires-python = ">=3.12"
# dependencies = [
#     "requests",
# ]
# ///

import requests

print(requests.get("https://pypi.org").status_code)

Run it with uv run, and uv reads the metadata, creates a temporary environment with the declared dependencies, and executes the script:

uv run example.py

You do not need to write the metadata block by hand. The uv init --script command creates a script with the block already in place, and uv add --script adds a dependency to an existing script:

uv init --script example.py
uv add --script example.py requests

This turns scripts into self-contained artefacts. A colleague can run your file with nothing more than uv installed, and get the same dependencies you used. It is a good fit for data exploration, small automation tasks, and examples in documentation, where a full project would be more ceremony than the task deserves.

6. Installing and Running Tools with uvx

Some Python packages are programs you run rather than libraries you import: formatters, linters, and command-line utilities. Installing those into a project environment pollutes it, and installing them globally with pip risks conflicts between tools that need different versions of the same library. uv solves this with isolated tool environments, driven by uv tool and its shortcut, uvx.

To run a tool once, without installing it anywhere permanent, use uvx:

uvx ruff check .
uvx black --check .

uv downloads the tool into a temporary environment, runs it, and cleans up afterwards. To keep a tool available on your path, install it instead:

uv tool install ruff
uv tool list
uv tool uninstall ruff

Each installed tool gets its own isolated environment, so two tools can depend on different versions of the same library without interfering with each other. Upgrading a tool is a single command, uv tool upgrade, and the tool environments live apart from your project environments, which keeps both clean.

This pattern is convenient for the utilities around a larger workflow. If you build applications with no-code or low-code platforms and still reach for Python utilities, for instance while following Building AI Applications with Dify: The Complete Guide in 9 Chapters, uvx lets you run formatters, linters, and small helpers without disturbing the environment your application actually runs in.

7. The pip-Compatible Interface and Migration

Teams rarely switch tools overnight, and uv was designed with that in mind. Alongside its project commands, it offers a pip-compatible interface under uv pip, which speaks the language of the tool it replaces:

uv venv
uv pip install requests
uv pip compile requirements.in -o requirements.txt
uv pip sync requirements.txt

These commands work with the familiar files: requirements.txt for pinned installs, requirements.in for the packages you choose directly, and a virtual environment created by uv venv. The difference is under the surface, where uv resolves and installs far faster than pip, and reuses its global cache.

Migration can therefore be gradual. A team can start by replacing pip install with uv pip install inside its existing workflow, and keep its requirements files and its virtual environment layout unchanged. When it is ready, it can adopt projects and the lockfile, move the dependency list into pyproject.toml, and let uv sync take over environment creation. At each step, the old workflow keeps working, which lowers the risk of the change.

A few habits need adjusting. Commands that used to be typed in an activated virtual environment, such as python -m pytest, become uv run pytest, which finds or creates the environment for you. Activation itself becomes optional rather than a daily ritual. And because uv manages the environment, the .venv directory it creates is a product of the project files, not something to commit or to copy between machines.

8. Performance, Caching and Workspaces

Source code on a developer's screen
Source code on a developer’s screen. Photo by qubodup, CC BY 2.0.

Speed in uv comes from several ideas working together. Resolution and downloads happen in parallel, the resolver is written in Rust, and the global cache means a package downloaded once is available to every project on the machine. When uv installs a package from the cache, it uses links to the cached files rather than copying them, so creating a new environment is cheap in both time and disk space.

The cache is shared across projects, but it is not a black box. You can inspect it, clean it, and prune entries you no longer need:

uv cache dir
uv cache prune

On a shared build machine or in continuous integration, a warm cache is what turns dependency installation from the slowest step of a build into a minor one. Even without a cache, the parallel downloads usually make a visible difference on a first install.

For larger codebases, uv supports Cargo-style workspaces. A workspace is a collection of related packages in one repository, with a shared lockfile at the root. A web service, its shared library, and its command-line tool can live side by side, depend on each other by path, and still be locked and installed as one unit. Commands such as uv sync --package let you work on one member of the workspace, while uv run --package runs a command in the context of a single member. The result is a monorepo workflow that stays manageable as the number of packages grows, without a separate tool to coordinate them.

9. Limitations and When to Choose Something Else

No tool fits every project, and uv is no exception. It is a young project that changes quickly. New commands appear, flags are renamed, and behaviour is refined between releases. That pace is a strength for a tool still finding its final shape, but it means documentation and tutorials can go out of date, and teams that value a frozen workflow may prefer to pin a version and upgrade deliberately.

The pip interface is a compatibility layer, not a complete copy of pip. Most everyday pip commands have an equivalent in uv, but unusual flags and edge cases may behave differently or be missing. If a build depends on a rare pip option, test it with uv before committing to the switch. The same caution applies to very unusual packaging layouts: uv covers the common cases well, and the uncommon ones may need a workaround or a different tool.

Migration cost is a real consideration too. A team with years of investment in Poetry or PDM, with plugins, scripts, and CI jobs built around them, gains little by switching for speed alone. The benefit of uv is largest for new projects, for teams frustrated by slow installs, and for developers who want one tool instead of several. Where the current setup works and is well understood, staying put is a reasonable choice.

Finally, uv is a Python tool. It does not manage system packages, Node dependencies, or other languages in a mixed repository. In a polyglot monorepo it is one tool among several, not a replacement for all of them. Judged on its own ground, though, it is a strong default for Python work in 2026.

Summary

uv brings the scattered pieces of Python packaging into a single, fast command. It installs without needing Python first, manages Python versions, creates projects with a universal lockfile, runs single-file scripts with their dependencies declared inline, and installs command-line tools in isolated environments. Its speed comes from a Rust implementation, parallel work, and a global cache, and its workspace support scales the same workflow from a single script to a monorepo. The current release at the time of writing is 0.13.13, published on 4 December 2026. For a new Python project, uv is the simplest starting point available today: install it, run uv init, and let one tool handle the rest.

Sources

1 thought on “uv: The Extremely Fast Python Package and Project Manager”

Leave a Comment