A year of uv: pros, cons, and should you migrate

(bitecode.dev)

Comments

barosl 19 February 2025
A very well written article! I admire the analysis done by the author regarding the difficulties of Python packaging.

With the advent of uv, I'm finally feeling like Python packaging is solved. As mentioned in the article, being able to have inline dependencies in a single-file Python script and running it naturally is just beautiful.

  #!/usr/bin/env -S uv run
  # /// script
  # dependencies = ['requests', 'beautifulsoup4']
  # ///
  import requests
  from bs4 import BeautifulSoup
After being used to this workflow, I have been thinking that a dedicated syntax for inline dependencies would be great, similar to JavaScript's `import ObjectName from 'module-name';` syntax. Python promoted type hints from comment-based to syntax-based, so a similar approach seems feasible.

> It used to be that either you avoided dependencies in small Python script, or you had some cumbersome workaround to make them work for you. Personally, I used to manage a gigantic venv just for my local scripts, which I had to kill and clean every year.

I had the same fear for adding dependencies, and did exactly the same thing.

> This is the kind of thing that changes completely how you work. I used to have one big test venv that I destroyed regularly. I used to avoid testing some stuff because it would be too cumbersome. I used to avoid some tooling or pay the price for using them because they were so big or not useful enough to justify the setup. And so on, and so on.

I 100% sympathize with this.

sieve 18 February 2025
Well, big fan of uv.

But... the 86GB python dependency download cache on my primary SSD, most of which can be attributed to the 50 different versions of torch, is testament to the fact that even uv cannot salvage the mess that is pip.

Never felt this much rage at the state of a language/build system in the 25 years that I have been programming. And I had to deal with Scala's SBT ("Simple Build Tool") in another life.

BrenBarn 19 February 2025
Like so many other articles that make some offhand remarks about conda, this article raves about a bunch of "new" features that conda has had for years.

> Being independent from Python bootstrapping

Yep, conda.

> Being capable of installing and running Python in one unified congruent way across all situations and platforms.

Yep, conda.

> Having a very strong dependency resolver.

Yep, conda (or mamba).

The main thing conda doesn't seem to have which uv has is all the "project management" stuff. Which is fine, it's clear people want that. But it's weird to me to see these articles that are so excited about being able to install Python easily when that's been doable with conda for ages. (And conda has additional features not present in uv or other tools.)

The pro and con of tools like uv is that they layer over the base-level tools like pip. The pro of that is that they interoperate well with pip. The con is that they inherit the limitations of that packaging model (notably the inability to distribute non-Python dependencies separately).

That's not to say uv is bad. It seems like a cool tool and I'm intrigued to see where it goes.

claytonjy 19 February 2025
A scenario for "don't use uv" I hope none of you encounter: many nvidia libraries not packaged up in something better like torch.

Here's just one example, nemo2riva, the first in several steps to taking a trained NeMo model and making it deployable: https://github.com/nvidia-riva/nemo2riva?tab=readme-ov-file#...

before you can install the package, you first have to install some other package whose only purpose is to break pip so it uses nvidia's package registry. This does not work with uv, even with the `uv pip` interface, because uv rightly doesn't put up with that shit.

This is of course not Astral's fault, I don't expect them to handle this, but uv has spoiled me so much it makes anything else even more painful than it was before uv.

serjester 18 February 2025
I think at this point, the only question it remains is how Astral will make money. But if they can package some sort enterprise package index with some security bells and whistles it seems an easy sell into a ton of orgs.
arnath 18 February 2025
I think the biggest praise I can give uv is that as a non Python dev, it makes Python a lot more accessible. The ecosystem can be really confusing to approach as an outsider. There’s like 5 different ways to create virtual environments. With uv, you don’t have to care about any of that. The venv and your Python install are just handled for you by ‘uv run’, which is magic.
something98 19 February 2025
Can someone explain a non-project based workflow/configuration for uv? I get creating a bespoke folder, repo, and uv venv for certain long-lived projects (like creating different apps?).

But most of my work, since I adopted conda 7ish years ago, involves using the same ML environment across any number of folders or even throw-away notebooks on the desktop, for instance. I’ll create the environment and sometimes add new packages, but rarely update it, unless I feel like a spring cleaning. And I like knowing that I have the same environment across all my machines, so I don’t have to think about if I’m running the same script or notebook on a different machine today.

The idea of a new environment for each of my related “projects” just doesn’t make sense to me. But, I’m open to learning a new workflow.

Addition: I don’t run other’s code, like pretrained models built with specific package requirements.

iandanforth 19 February 2025
Since this seems to be a love fest let me offer a contrarian view. I use conda for environment management and pip for package management. This neatly separates the concerns into two tools that are good at what they do. I'm afraid that uv is another round of "Let's fix everything" just to create another soon to be dead set of patterns. I find nothing innovative or pleasing in its design, nor do I feel that it is particularly intuitive or usable.

You don't have to love uv, and there are plenty of reasons not to.

digdugdirk 19 February 2025
I'm very much looking forward to their upcoming static type checker. Hopefully it will lead to some interesting new opportunities in the python world!
shlomo_z 19 February 2025
A familiar tale: Joe is hesitant about switching to UV and isn't particularly excited about it. Eventually, he gives it a try and becomes a fan. Soon, Joe is recommending UV to everyone he knows.
NeutralForest 18 February 2025
uv is so much better than everything else, I'm just can't afraid they can't keep the team going. Time will tell but I just use uv and ruff in every project now tbh.
motorest 19 February 2025
I know good naming is hard, and there are an awful lot of project names that clash, but naming a project uv is unfortunate due to the ubiquitous nature of libuv

https://libuv.org/

pityJuke 18 February 2025
uv is overposted as hell, but oh my god I love it so much I understand every single one of these posts. Simple things just work so effectively.
locusofself 19 February 2025
I've been mostly out of the python game for quite a while, but I never had that much issue with: pip install -r requirements.txt .

Seems like a lot of people have tried their hand at various tooling, so there must be more to it than I am aware of.

perrygeo 19 February 2025
> You don't even need to know there is a venv, or what activation means.

> All those commands update the lock file automatically and transparently.... It's all taken care of.

When is the python community going to realize that simple is the opposite of easy? I don't see how hiding these aspects is desirable at all; I want to know how my programming tools work!

With all due respect to the author, I don't like the assumption that all programmers want magic tools that hide everything under the rug. Some programmers still prefer simplicity, ie understanding exactly what every part of the system does.

Nothing against uv, it seems like a fine tool. And I'm sure one could make a case for it on other technical merits. But choosing it specifically to avoid critical thinking is self-defeating.

remram 19 February 2025
The problem I have with uv is that it is not opinionated enough, or complete enough. It still needs a backend for building the package, and you still have a choice of backends.

In other words, it is a nice frontend to hide the mess that is the Python packaging ecosystem, but the mess of an ecosystem is still there, and you still have to deal with it. You'll still have to go through hatchling's docs to figure out how to do x/y/z. You'll still have to switch from hatchling to flit/pdm/setuptools/... if you run into a limitation of hatchling. As a package author, you're never using uv, you're using uv+hatchling (or uv+something) and a big part of your pyproject.toml are not uv's configuration, it is hatchling configuration.

I'm sticking with Poetry for now, which has a more streamlined workflow. Things work together. Every Poetry project uses the same configuration syntax (there are no Poetry+X and Poetry+Y projects). Issues in Poetry can be fixed by Poetry rather than having to work with the backend.

I understand that uv is still young and I am sure this will improve. Maybe they'll even pick a specific backend and put a halt to this. But of course Poetry might catch up before then.

belval 18 February 2025
> I had a friend who decided to not use uv, because the first time he used it, it was on a 15 years old codebase that had just been migrated to Python 3. It was standing on a pile of never cleaned up pip freeze exports, and uv could not make it work.

This is my only gripe with uv, despite how the author decided to depict it, this really turns into a headache fast as soon as you have ~4-5 in-house packages.

I don't think it's that bad that uv is so unforgiving in those case because it leads to better overall project quality/cohesion, but I wish there was a way to more progressively onboard and downgrade minor version mismatch to warnings.

yair99dd 18 February 2025
> uv's handling of pre-releases is... unusual. https://github.com/astral-sh/uv/issues/10138
evanwpm 19 February 2025
uv has been a complete game changer for me in Python, everyone who develops with me knows I won't shut up about it.

Astral is a great team, they built the ruff linter and are currently working on a static type checker called red-knot: https://x.com/charliermarsh/status/1884651482009477368

antirez 19 February 2025
uv may be an improvement, but the Python packaging hell is a cultural problem that will not be solved without changing culture. And the main cultural issue is: 1. Depending on small and huge packages for trivial things. 2. A culture of breaking API compatibility. The two things combined create the mess we see.
gkfasdfasdf 19 February 2025
I am a casual python user, and for that I love uv. Something I haven't quite figured out yet is integration with the pyright lsp - when I edit random projects in neovim, any imports have red squiggles. Does anyone know of a good way to resolve imports for the lsp via uv?
__rito__ 19 February 2025
Is there a conda to uv migration tutorial written by anyone?

I have installed miniconda system-wide. For any Python package that I use a lot, I install them on base environment. And on other environments. Like ipython.

For every new project, I create a conda environment, and install everything in it. Upon finishing/writing my patch, I remove that environment and clean the caches. For my own projects, I create an environment.yaml and move on.

Everything works just fine. Now, the solving with mamba is fast. I can just hand someone the code and environment.yaml, and it runs on other platforms.

Can someone say why using uv is a good idea? Has anyone written a migration guide for such use cases?

I am mightily impressed by one line dependency declaration in a file. But I don't know (yet) where the caches are stored, how to get rid of them later, etc.

BeetleB 19 February 2025
It seems like uv doesn't target replacing pipenv...? No mention of it in their docs and there is an open Github issue about it.

I have yet to learn uv, but I intend to. Still, having to ".venv/bin/activate" to activate the virtualenv is a lot less ergonomic than "pipenv shell".

mathisd 19 February 2025
I really like uv and I have successfully got rid of miniconda but : - I wish there was a global virtual environment which could be referenced and activated from terminal. Not every new scripts needs their own .venv in their respective folder. uv takes the route of being project centered and based on file system, this works for me most of the time but sometime it doesn't. - I wish we could avoid the .python_version file and bundle it in the pyproject.toml file.
zellyn 19 February 2025
I've been using Hermit to install uv, then pointing scripts at $REPO_ROOT/bin/uv. That gives you a repo where the scripts can be run directly after cloning (Hermit is smart enough to install itself if necessary).

Unfortunately, Hermit doesn't do Windows, although I'm pretty sure that's because the devs don't have Windows machines: PRs welcome.

https://github.com/cashapp/hermit

cjohnson318 18 February 2025
Honest question: is uv more reproducible/portable than cramming your Python project into a Docker container? I've used pyenv, pip, venv, and a couple of other things, and they all work fine, at first, in simple scenarios.
prisenco 19 February 2025
I can't speak to uv from an app dev perspective (I use Go for that), but as someone who dips into the Python world for data science reasons only, uv is great and I'm thankful for it.
xyse53 18 February 2025
Adding to the article (which I agree with): Lack of `uv pip install --user` has made transitioning our existing python environment a bit more challenging than I'd like, but not a deal breaker.
nchmy 19 February 2025
Just going to plug https://mise.jdx.dev as a perfect accompaniment to uv. It simplifies installing tooling across languages and projects. I even install uv via mise, and it uses uv under the hood for Python related things.
datadeft 19 February 2025
Now we should just figure out why to stop here. Why not write everything in Rust? Recently I have moved all my projects to Rust from Python and never looked back. Of course we need projects like Torch and we are not yet there, but those simpler projects that do not require GPU libraries Rust is great.
upbeat_general 19 February 2025
I tried out uv a bit ago and dropped it. But about two weeks ago, I switched to it and migrated two projects with no issues.

Things like pypi sources per dep are there finally.

I still find rough points (as many others pointed out, especially with non sandboxed installs), that are problematic, but on the whole it’s better than Mamba for my use.

IAmNotACellist 18 February 2025
Is uv better than micromamba? I tried using uv once and got some big ugly error I don't remember, and that was the end of that, whereas mm just worked (perhaps due to my familiarity). It was a project with the usual situation, i.e., torch, numpy, cuda support, nvcc, all had to play nicely together and satisfy requirements.txt.
DoingIsLearning 19 February 2025
As a dabbler (using python mostly for internal engineering tools and post processing of data) I am using uv at home but not in a professional setting.

The latest release is at 0.6.1, what is missing (roadmap/timeline wise) for uv to exist as a 1.0 release?

jquaint 19 February 2025
I excited to try uv for my next project. It seems like a good future proof way to package python packages in Nix. https://github.com/pyproject-nix/uv2nix
lysecret 19 February 2025
Really like uv too but surprised he doesn’t mention the lack of conda compliance. Some scientific packages only being available on conda is the only reason I can’t use uv (but micromamba) for some projects.
triyambakam 19 February 2025
I didn't find any mention comparing it to rye. Anyone have any insight? I am pretty distant from the day to day Python ecosystem lately
microflash 19 February 2025
uv has been fantastic for most of my personal projects. It feels so much smoother than any other python tooling combo I tried in past. That said, it just does not work well behind corporate proxies. This is single most annoying thing that has stopped me from recommending it at work.
speakspokespok 19 February 2025
Has anyone built pipy packages with `uv`? Does doing so affect the end-user at all?
davedx 19 February 2025
Astral is doing phenomenal work.

I'm extremely excited about the ruff type checker too.

ijustlovemath 19 February 2025
How are they handling the returns VCs expect through this free software? If it's so easy to deploy, surely we should expect a Docker-like licensing model in the near future?
torcete 19 February 2025
uv, venv, conda, brew, deb, nix, guix, chocolatey, containers, jails... One day we will finally find the ONE solution to this problem.
k2enemy 19 February 2025
uv is just so damn good.

All else equal, I prefer julia to python, but uv makes the python experience so much nicer. I'd love it if julia copied uv and replaced the Pkg system with it.

ashishb 19 February 2025
Has someone migrated from poetry to uv? Any benefits?
d3v1an7 19 February 2025
great write up! have only dabbled in python, but dabbled enough to understand and _feel_ each dotpoint under "what problems uv tries to solve".
tiltowait 19 February 2025
The challenge I have with adopting uv is it feels like it doesn't have a great replacement for poetry's `[tool.poetry.scripts]` block.

For instance, from a personal project that uses a src layout, without being a package, I have this in my pyproject.toml:

[tool.poetry] ... packages = [{ include = "*", from = "src", format = "sdist" }] ...

[tool.poetry.scripts] botch = "launcher:run_bot('botch')" beat = "launcher:run_bot('beat')"

I can't find any way to get that working in uv without some pretty major refactoring of my internal structure and import declarations. Maybe I've accidentally cornered myself in a terrible and ill-advised structure?

riskneutral 18 February 2025
is this better than miniconda?
BiteCode_dev 19 February 2025
Author here. A.m.a
meindnoch 19 February 2025
Ok, so apparently `uv` has nothing to do with `libuv`.
IshKebab 18 February 2025
Yes. Python tooling has been shit for decades and `uv` is actually good.
mherrmann 19 February 2025
> There are a lot of different ways to install Python, all with different default settings, and gotchas.

With uv, there is now one more.

https://xkcd.com/927/

3l3ktr4 18 February 2025
I thought this was going to be about the UV rays from the sun... But it's another python package manager. We're running out of names.
egorfine 19 February 2025
Can anyone explain to a non-python developer why python infrastructure is so much broken around the version management?

It looks to me that every new minor python release is a separate additional install because realistically you cannot replace python 3.11 with python 3.12 and expect things to work. How did they put themselves in such a mess?

MassPikeMike 19 February 2025
I have seen references to using uv for Python package management before and been thoroughly confused. I never realized it was not the same thing as the very nice asynchronous cross-platform library libuv (https://libuv.org/) and I could never figure out what that library had to do with Python package management (answer: nothing).

Maybe we need a Geographic Names Board to deconflict open source project names, or at least the ones that are only two or three characters long.