Wednesday, August 5, 2026

I Changed Pip, Virtualenv, and Poetry With uv: Right here’s Why


 

The Python Mess

 
Python packaging has all the time felt a bit messy to me. For one mission, I might use pip to put in packages globally as a result of I forgot to create a digital setting. For one more, I might create a venv, overlook to activate it, and by accident set up packages globally once more.

For larger initiatives, I might swap to Poetry for dependency administration, packaging, and lock information. It’s a highly effective instrument, however in comparison with pip, it usually felt sluggish and heavy for the sort of initiatives I used to be constructing.

None of those instruments are dangerous. They’re widespread for good causes. pip is the default bundle installer for Python, venv helps create remoted environments, and Poetry provides you dependency administration and reproducible lock information.

However after utilizing uv, I began asking myself one easy query:

Why am I utilizing three completely different instruments when one instrument can do many of the work?

 

What Is uv?

 
uv is a quick Python bundle and mission supervisor constructed by Astral, the identical crew behind Ruff.

The simplest means to consider uv is that this: as a substitute of utilizing one instrument for putting in packages, one other for digital environments, one other for lock information, and one other for managing Python variations, uv brings most of that workflow into one place.

It could exchange instruments like pip, pip-tools, pipx, Poetry, pyenv, twine, and virtualenv for a lot of widespread Python workflows.

It’s also a lot quicker than the normal setup. uv is designed to be 10-100x quicker than pip (in accordance with Astral’s benchmarks), helps mission administration, creates lock information, manages Python variations, and nonetheless gives a well-known pip-compatible interface.

That feels like a giant declare, however in every day use, the principle profit is easy:

uv makes Python mission setup quicker, cleaner, and fewer annoying.

 

My Previous Python Workflow

 
Earlier than uv, my Python workflow normally appeared one thing like this.

First, I might create a digital setting:

python -m venv .venv
supply .venv/bin/activate

 

On Home windows, I might activate it with:

.venvScriptsActivate.ps1

 

Then I might set up the packages I wanted:

pip set up pandas scikit-learn streamlit
pip freeze > necessities.txt

 

For bigger initiatives, I might normally swap to Poetry:

poetry init
poetry add pandas scikit-learn streamlit
poetry run python principal.py

 

This labored, nevertheless it all the time felt like I used to be leaping between completely different instruments and completely different workflows.

Typically I had a necessities.txt file. Typically I had a pyproject.toml file. Typically I had a lock file. Typically I forgot to activate the digital setting and put in packages globally by mistake.

None of this was unimaginable to handle, nevertheless it was not clear both. I wished a workflow that felt quicker, less complicated, and extra constant throughout small scripts, information science initiatives, and bigger Python functions.

 

My New Workflow With uv

 
With uv, beginning a brand new Python mission feels a lot less complicated.

I can create a mission, add dependencies, and run the code with only a few instructions:

uv init my-project
cd my-project
uv add pandas scikit-learn streamlit
uv run principal.py

 

That is it.

Once I run these instructions, uv handles many of the setup for me. It creates the mission construction, manages dependencies in pyproject.toml, creates a .venv setting, and generates a uv.lock file for reproducible installs.

 
I Replaced Pip, Virtualenv, and Poetry With uv: Here's Why
 

So as a substitute of manually making a digital setting, activating it, putting in packages, and freezing dependencies, I can let uv handle the complete workflow.

One of the best half is that I should not have to activate the setting each time.

As an alternative of doing this:

supply .venv/bin/activate
python script.py

 

I can simply run:

 

uv run checks that the setting is in sync with the lock file after which runs the command utilizing the proper dependencies.

For me, that is the most important quality-of-life enchancment. I spend much less time desirous about environments and extra time really constructing the mission.

 

Why I Like uv

 
The primary cause I like uv is that it removes plenty of small annoyances from on a regular basis Python improvement.

 

// Bringing the Python Workflow Into One Instrument

That is the most important cause I switched.

Earlier than uv, my workflow was cut up throughout completely different instruments. I used pip to put in packages, venv or virtualenv to create environments, pip freeze to generate a necessities.txt file, Poetry for bigger initiatives, and generally pyenv for managing Python variations.

Every instrument solved a special drawback, however collectively the workflow felt scattered.

With uv, most of this will occur in a single place:

uv init
uv add requests
uv add --dev pytest
uv run pytest

 

This creates a cleaner workflow. I can create the mission, add dependencies, handle the setting, generate a lock file, and run instructions with out continually switching between instruments.

That’s the actual profit for me. uv isn’t just a quicker pip. It provides me one constant option to handle Python initiatives.

 

// Being Quick

Velocity is just not every little thing, nevertheless it issues if you end up creating initiatives repeatedly.

Putting in dependencies with pip can really feel sluggish, particularly in recent environments or CI pipelines. uv is written in Rust and is designed for pace, and in my very own workflow, that distinction is noticeable.

Undertaking setup feels a lot quicker with uv, particularly for initiatives that want heavier dependencies like transformers, torch, scikit-learn, or different information science and machine studying packages.

One other factor I like is that I should not have to assume as a lot about dependency decision. uv handles the setting, resolves dependencies, updates the lock file, and retains issues in sync mechanically.

In regular day-to-day work, this implies much less ready, fewer setup points, and extra time really constructing.

 

// Making Undertaking Setup Cleaner

With uv, the mission move feels extra trendy:

uv init
uv add fastapi
uv add --dev pytest
uv run pytest

 

This retains dependencies inside pyproject.toml, creates a lock file, and makes the mission simpler to breed on one other machine.

As an alternative of telling somebody:

 

“Create a digital setting, activate it, set up the necessities, and ensure the Python model is right.”

 

You may usually simply say:

 

That’s a lot cleaner.

 

// Making Migration Simple

One more reason I like uv is that I should not have to alter every little thing directly.

If I’ve an older mission that also makes use of a necessities.txt file, I can use uv with out changing the entire mission to the complete uv workflow.

For instance:

uv venv
supply .venv/bin/activate
uv pip set up -r necessities.txt

 

On Home windows, I can activate the setting with:

.venvScriptsActivate.ps1

 

Then set up the dependencies:

uv pip set up -r necessities.txt

 

That is helpful as a result of migration doesn’t must be all or nothing. I can begin through the use of uv as a quicker installer in present initiatives, then use uv init, uv add, and uv sync for brand spanking new initiatives.

That makes uv straightforward to undertake progressively as a substitute of forcing a full workflow change on day one.

 

// Managing Python Variations

One other good characteristic is that uv can set up and handle Python variations too. This implies it could additionally exchange components of a pyenv workflow for many individuals.

For instance, I can set up a selected Python model:

 

Then pin my present mission to make use of that model:

 

After that, I can create or sync the setting as normal:

 

So as a substitute of individually managing Python variations, digital environments, and dependencies, I can hold extra of that workflow inside one instrument.

 

Putting in uv

 
Putting in uv is simple. Open your terminal or PowerShell and run the command in your working system.

For macOS and Linux:

curl -LsSf https://astral.sh/uv/set up.sh | sh

 

For Home windows PowerShell:

irm https://astral.sh/uv/set up.ps1 | iex

 

That’s the best option to set up uv utilizing the official standalone installer.

You may as well set up uv utilizing pip, Homebrew, WinGet, Scoop, Docker, Cargo, and different strategies. However for many customers, the standalone installer is the best possibility.

 

Ought to You Change to uv?

 
For brand spanking new Python initiatives, I feel uv is a straightforward suggestion.

It’s quick, trendy, and brings mission setup, dependency administration, digital environments, lock information, Python variations, and power execution into one workflow. The docs additionally say uv gives a well-known pip-compatible interface, so you can begin with uv pip earlier than totally transferring to uv init, uv add, and uv sync.

That stated, I might not inform everybody to modify instantly. For information science rookies, conda remains to be an excellent start line as a result of it’s extensively used for managing environments and packages in information science workflows.

For vibe coders utilizing AI coding instruments, pip, venv, and necessities.txt are nonetheless value figuring out as a result of many AI fashions are educated on older Python workflows and will generate directions that don’t work easily with uv.

However for Python builders, product engineers, and folks organising initiatives usually, I might extremely advocate attempting uv. It provides you a cleaner workflow and likewise consists of uvx, which works like npx for Python instruments. You may run Python-based command-line interface (CLI) instruments in remoted non permanent environments with out putting in them globally.

So my suggestion is easy: hold conda if you’re simply beginning with information science, study pip as a result of it’s nonetheless in all places, however use uv for brand spanking new Python initiatives the place you desire a quicker and cleaner developer expertise.
 
 

Abid Ali Awan (@1abidaliawan) is a licensed information scientist skilled who loves constructing machine studying fashions. At the moment, he’s specializing in content material creation and writing technical blogs on machine studying and information science applied sciences. Abid holds a Grasp’s diploma in expertise administration and a bachelor’s diploma in telecommunication engineering. His imaginative and prescient is to construct an AI product utilizing a graph neural community for college kids battling psychological sickness.

Related Articles

Latest Articles