DEV Community

Cover image for Say Hello to UV: A Fast Python Package & Project Manager Written in Rust
Athreya aka Maneshwar
Athreya aka Maneshwar

Posted on

Say Hello to UV: A Fast Python Package & Project Manager Written in Rust

If you’ve been managing Python projects long enough, you’ve probably dealt with a mess of tools: pip, pip-tools, poetry, virtualenv, conda, maybe even pdm.

Each brings something useful to the table, but also adds to the complexity.

UV — a fast, Rust-powered Python package and project manager that aims to unify and simplify all of this.

What is UV?

UV is a blazing-fast package and project manager for Python, written in Rust.

Think of it as a single tool to replace:

  • pip
  • pip-tools
  • virtualenv
  • pyenv
  • poetry
  • pdm
  • and more...

It handles dependency installation, environment management, Python version management, and script execution, all from a single CLI tool.

Why is UV So Fast?

The secret sauce? UV is written in Rust, which brings serious speed gains over traditional Python-based tooling.

Benchmarks from the UV docs claim it's 10 to 100 times faster than pip. And in practice, it does feel ridiculously quick — installing NumPy, pandas, and other large libraries takes seconds, not minutes.

Installing UV

To get started:

pip install uv
Enter fullscreen mode Exit fullscreen mode

You can also install it via curl or PowerShell, and it works across macOS, Linux, and Windows.

Getting Started with UV

Let’s walk through a quick project setup using UV.

Step 1: Create a New Project

uv init uv-demo
Enter fullscreen mode Exit fullscreen mode

This creates a structured project folder:

uv-demo/
├── .gitignore
├── main.py
├── project.uv.toml
├── README.md
└── .python-version
Enter fullscreen mode Exit fullscreen mode

Image description

Step 2: Create a Virtual Environment

uv venv
Enter fullscreen mode Exit fullscreen mode

This instantly creates a virtual environment using the selected Python version — no more typing python -m venv venv.

To activate it (Linux/macOS):

source .venv/bin/activate
Enter fullscreen mode Exit fullscreen mode

Or on Windows:

.venv\Scripts\activate
Enter fullscreen mode Exit fullscreen mode

Image description

Step 3: Add Dependencies

Adding dependencies is straightforward:

uv add numpy pandas
Enter fullscreen mode Exit fullscreen mode

This installs the packages and updates your project.uv.toml file:

Image description

Step 4: Install from requirements.txt

You can even install dependencies from a requirements.txt file:

# requirements.txt
numpy
pandas
Enter fullscreen mode Exit fullscreen mode

Then run:

uv add -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

Step 5: Run Python Scripts

Instead of:

python main.py
Enter fullscreen mode Exit fullscreen mode

With UV, just use:

uv run main.py
Enter fullscreen mode Exit fullscreen mode

This runs your script using the active environment.

Image description

Managing Python Versions

UV also supports managing Python versions:

uv python install 3.12
uv python install 3.11
Enter fullscreen mode Exit fullscreen mode

Then create environments using a specific version:

uv venv --python 3.11
Enter fullscreen mode Exit fullscreen mode

Image description

Highlights

  • ⚡ Lightning-fast installs (thanks, Rust)
  • 🧰 Replaces multiple tools with one CLI
  • 🔁 Automatically handles venv and Python version management
  • 📦 Supports requirements.txt
  • 💻 Cross-platform: Linux, macOS, and Windows
  • ✨ Familiar pip-like syntax

TL;DR

UV simplifies Python project setup and dependency management into one consistent, fast, and modern tool.

Whether you’re tired of juggling venv, pyenv, and pip, or just want something faster, UV is worth trying out.


I’ve been actively working on a super-convenient tool called LiveAPI.

LiveAPI helps you get all your backend APIs documented in a few minutes

With LiveAPI, you can quickly generate interactive API documentation that allows users to execute APIs directly from the browser.

Image description

If you’re tired of manually creating docs for your APIs, this tool might just make your life easier.

Top comments (2)

Collapse
 
john_matthew_82c0880ee1c1 profile image
John M

UV is amazing, esp. for Windows users

Myself, I use winget for installing stuff on Windows.

winget install astral-sh.uv
Enter fullscreen mode Exit fullscreen mode

Then all my python projects use the Windows installed version of UV, no need to install Python in Windows (not that MS hasn't crushed that now)

Collapse
 
lovestaco profile image
Athreya aka Maneshwar

Haha nice