DEV Community

Cover image for How to Switch to uv: Replace pip, virtualenv, and Poetry in Your Python Project
Dev Encyclopedia
Dev Encyclopedia

Posted on • Originally published at devencyclopedia.com

How to Switch to uv: Replace pip, virtualenv, and Poetry in Your Python Project

If you've worked on a Python project for more than a year, you know the drill: pip to install packages, virtualenv or venv to isolate environments, pyenv to manage Python versions, and pip-tools to generate a lockfile. Four separate tools, four config formats, and four different points of failure in CI.

uv, built by Astral (the team behind ruff), collapses all of that into a single Rust binary. It's not a modest speed bump either, we're talking 10 to 100x faster than pip on cold installs and near-instant on warm ones. In CI, where the cache is cold on every run, that difference is often the gap between a multi-minute install and one that finishes in seconds.

This isn't a "starting fresh" tutorial. It's specifically about migrating a project that already has a requirements.txt or a Poetry-based pyproject.toml, since that's the situation most of us are actually in.

The guide covers the real friction points: importing an existing requirements.txt cleanly (there's a one-liner for simple files and a safer fallback for ones with pins, comments, or extras), migrating off Poetry with a dedicated conversion tool, what doesn't auto-migrate (dependency groups, private indexes, poetry run calls), pinning your Python version so the whole team and CI stay in sync, and wiring up GitHub Actions with the one flag that keeps your lockfile honest.

I break down every step, plus the actual benchmark numbers, here: https://devencyclopedia.com/blog/switch-to-uv-python

Top comments (0)