May 1, 2025career

Tired of Pip and Venv? Try UV Instead

If you've ever found Python’s package and environment management a bit clunky — juggling pip, venv, pip-tools, and pipx — you’re not alone. These tools get the job done, but the setup can feel like a chore, especially if you're new to Python.

Featured image for Tired of Pip and Venv? Try UV Instead

What if there was a single, fast, all-in-one tool that could do it all?

👉 Meet UV — a blazing-fast Python package manager built in Rust by the folks behind the popular linter Ruff. UV aims to replace pip, venv, pip-tools, and even pipx — all through one intuitive interface.


The Traditional Workflow: Too Many Moving Parts

Here’s what starting a typical Python project often looks like:

  1. Create a project folder
  2. cd into it
  3. Run python -m venv .venv to create a virtual environment
  4. Activate the virtual environment
  5. Run pip install to add packages like Flask or Requests
  6. Create your code file (main.py)
  7. Freeze dependencies into a requirements.txt
  8. Share the project? The other person repeats all of this again.

Enter UV: The Streamlined Workflow

1. Project Setup Made Simple

Just run:

uv init my_project

2. Virtual Environments: Automated & Invisible

You don’t need to manually create or activate environments. When you install your first package, UV:

  • Creates a .venv folder automatically
  • Isolates your environment
  • Installs everything super fast (thanks, Rust!)

3. Adding & Managing Dependencies

Want to add packages?

uv add flask requests

UV updates your pyproject.toml and generates a uv.lock file — ensuring exact reproducibility across machines. You also get:

  • uv remove <package> to uninstall
  • uv sync to recreate the exact environment from uv.lock

4. Running Code Without Activation

No need to activate the environment:

uv run main.py

Even if .venv is missing, UV will recreate it, install everything, and run your script — in one shot.

5. Visualize Your Dependency Tree

Want to see which packages depend on what?

uv tree

This gives you a clean, hierarchical view of your project dependencies.


Installing CLI Tools (Like pipx, but Better)

UV can also handle command-line tools like ruff, httpie, etc.

  • Install globally: uv tool install ruff
  • Run temporarily: uv tool run ruff check . or shortcut: uvx ruff check .
  • Uninstall: uv tool uninstall ruff
  • Upgrade: uv tool upgrade or uv tool upgrade --all
  • List tools: uv tool list

No polluting global Python, no version clashes, and it’s fast.


Why Switch to UV?

  • Speed: Written in Rust. UV is much faster than pip & friends.
  • All-in-One: Replace 4 tools (pip, venv, pip-tools, pipx) with 1.
  • Smart Caching: Packages are stored once, reused everywhere.
  • Zero Manual Activation: Environment is auto-handled.
  • Reproducibility: Lock files guarantee same environment for everyone.
  • Beginner-Friendly: Great for newcomers — fewer commands, less confusion.

Migrating from an Existing Project?

Already have a project with requirements.txt?

  1. Run uv init inside your existing folder
  2. Then:
uv add -r requirements.txt

Boom — you're on UV, with lock files and all.

You can also ease in by using:

uv pip install <package>

This works like pip, but faster. Just note: this won’t create pyproject.toml or lock files — so you’ll miss out on UV’s core power.


Final Thoughts

UV is more than just faster tooling. It’s a rethinking of the Python development experience. From auto environments to lock files, to smart caching and CLI tool management — UV takes the complexity out of the equation.

If you’re tired of juggling tools, waiting for installs, or explaining venv to a newbie — UV might just be your new best friend.

👉 Try it out: https://github.com/astral-sh/uv

Share:
Reading time:4 min read