Live data from Hacker News

Uv is the best thing to happen to the Python ecosystem in a decade

emily.space

191–200 of 1001 posts

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#191
post #72

Earlier quoted context omitted.

Your implication is that pyenv, virtualenv, and pip should be 3 different tools. But for the average developer, these tools are all related to managing the python environment and versions which in my head sounds like one thing. Other languages don't have 3 different tools for this. pip and virtualenv also add a ton of complexity and when they break (which happens quite often) debugging it is even harder despite them…

Yeah, I agree. In particular it seems insane to me that virtualenv should have to exist. I can't see any valid use case for a machine-global pool of dependencies. Why would anyone think it should be a separate tool rather than just the obvious thing that a dependency manager does? I say this as someone with nearly 20 years of Python experience. It's the same sort of deal with pyenv--the Python version is itself a dep…

I, too, have ~20 years of Python experience.

`virtualenv` is a heavy-duty third-party library that adds functionality to the standard library venv. Or rather, venv was created as a subset of virtualenv in Python 3.3, and the projects have diverged since.

The standard library `venv` provides "obvious thing that a dependency manager does" functionality, so that every dependency manager has the opportunity to use it, and so that developers can also choose to work at a lower level. And the virtual-environment standard needs to exist so that Python can know about the pool of dependencies thus stored. Otherwise you would be forced to... depend on the dependency manager to start Python and tell it where its dependency pool is.

Fundamentally, the only things a venv needs are the `pyvenv.cfg` config file, the appropriate folder hierarchy, and some symlinks to Python (stub executables on Windows). All it's doing is providing a place for that "pool of dependencies" to exist, and providing configuration info so that Python can understand the dependency path at startup. The venvs created by the standard library module — and by uv — also provide "activation" scripts to manipulate some environment variables for ease of use; but these are completely unnecessary to making the system work.

Fundamentally, tools like uv create the same kind of virtual environment that the standard library does — because there is only one kind. Uv doesn't bootstrap pip into its environments (since that's slow and would be pointless), but you can equally well disable that with the standard library: `python -m venv --without-pip`.

> the Python version is itself a dependency of most libraries

This is a strange way of thinking about it IMO. If you're trying to obtain Python libraries, it's normally because you already have Python, and want to obtain libraries that are compatible with the Python you already have, so that you can write Python code that uses the libraries and works under that Python.

If you're trying to solve the problem of deploying an application to people who don't have Python (or to people who don't understand what Python is), you need another layer of wrapping anyway. You aren't going to get end users to install uv first.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#192
post #92

Earlier quoted context omitted.

It would be nice indeed if there was a good solution to multi-gigabyte conda directories. Conda has been reproducible in my experience with pinned dependencies in the environment YAML... slow to build, sure, but reproducible.

I'd argue bzip compression was a mistake for Conda. There was a time when I had Conda packages made for the CUDA libraries so conda could locally install the right version of CUDA for every project, but boy it took forever for Conda to unpack 100MB+ packages.

It seems they are using zstd now for .conda packages, eg, bzip is obsoleted, so that should be faster.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#193

I gotta say, I feel pretty vindicated after hearing for years how Python’s tooling was just fine and you should just use virtualenv with pip and how JS must be worse, that when Python devs finally get a taste of npm/cargo/bundler in their ecosystem, they freaking love it. Because yes, npm has its issues but lock files and consistent installs are amazing

poetry gave us lock files and consistent installs for years. uv is much, much faster however.

I used poetry professionally for a couple of years and hit so many bugs, it was definitely not a smooth experience. Granted that was probably 3-4 years ago.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#194
post #46

For single-file Python scripts, which 99% of mine seem to be, you can simplify your life immensely by just putting this at the top of the script: #!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.11" # dependencies = [ "modules", "here" ] # /// The script now works like a standalone executable, and uv will magically install and use the specified modules.

> uv will magically install and use the specified modules. As long as you have internet access, and whatever repository it's drawing from is online, and you may get different version of python each time, ...

And electricity and running water and oh the inconvenience. How is this worse than getting a script file that expects you to install modules?

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#195

curl|sh and iwr|iex chills my spine, no one should recommend these methods of installation in 2025. I'm against closed computers but I'm also against reckless install. Even without the security concerns these way of installation tends to put files in a whole random places making it hard to manage and cleanup.

Installing an out-of-distro deb/rpm/msi/dmg/etc package is just as unsafe as curl|sh. Or even unsafer, as packages tend to require root/admin.

Security and auditability is not the core problem, it's versioning and uninstalling. https://docs.sweeting.me/s/against-curl-sh

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#196

But what was wrong with pip, venv and pyproject.toml in the first place? I just keep a system installation of python for my personal things and an environment for every project I'm working on. I'd get suspicious if a developer is picky about python versions or library versions like what crazy programs are you writing?

What's wrong? Having modify the shell environment, no lockfile, slow download/installation, lack of a standard dependency dir, ...

> I'd get suspicious if a developer is picky about python versions or library versions

Certain library versions only support certain python versions. And they also break API. So moving up/down the python versions also means moving library versions which means stuff no longer works.

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#197
post #175

Earlier quoted context omitted.

> All these comments look like advertisement. "uv is better than python!!", "8/10 programmers recommend uv", "I was a terrible programmer before but uv changed my life!!", "uv is fast!!!" Have you tried uv?

Why would I? Does it offer something that standard python tools doesn't? Why uv over, lets say, conda?

FWIW I asked the same question last time a uv thread was posted (two weeks ago) - got some legit answers, none that swayed me personally but I can see why people use it. Also lots of inexplicable love for it https://news.ycombinator.com/item?id=45574550

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#198
post #82

Earlier quoted context omitted.

Your point being? EDIT: Looks like I fell hook, line, and sinker for the troll. Shame on me.

[flagged]

> no point in trusting people who are disconnect from reality

My brother in christ, we are all just names without bodies or even faces on this digital ocean of the internet. Letting people know how they should address you isn't "disconnected from reality", it's grounded in the very real reality that we, as people, like talking to each other. We should all be so thankful for their foresight in allowing us the opportunity of avoiding an otherwise unavoidable faux pas of calling everyone in the world "hey you".

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#199
Every time I see one of these comment threads it seems like uv desperately needs a better home page that doesn’t start with a long list of technical stuff. It’s really simple to use, in fact so simple that it confuses people!

The home page should be a simplified version of this page buried way down in the docs: https://docs.astral.sh/uv/guides/projects/

Re: Uv is the best thing to happen to the Python ecosystem in a decade

#200
post #175

Earlier quoted context omitted.

> All these comments look like advertisement. "uv is better than python!!", "8/10 programmers recommend uv", "I was a terrible programmer before but uv changed my life!!", "uv is fast!!!" Have you tried uv?

Why would I? Does it offer something that standard python tools doesn't? Why uv over, lets say, conda?

> Does it offer something that standard python tools doesn't?

Other than speed and consolidation, pip, pipx, hatch, virtualenv, and pyenv together roughly do the job (though pyenv itself isn’t a standard python tool.)

> Why uv over, lets say, conda?

Support for Python standard packaging specifications and consequently also easier integration with other tools that leverage them, whether standard or third party.

Post reply on HN