Posted by todsacerdoti 3/29/2025

356 points | 108 commentspage 2
egeres 3/30/2025|
I love it, it feels like an extension of these other HN posts:

- Uv's killer feature is making ad-hoc environments easy (valatka.dev): https://news.ycombinator.com/item?id=42676432

- Using uv as your shebang line (akrabat.com): https://news.ycombinator.com/item?id=42855258

krupan 3/30/2025||
Overall, and admittedly from a bit of a distance, uv run feels like a reinvention of Zero Install, but for only Python.

I also wondered why virtual environments were invented for Python when general environment managers (like Modules) already existed.

These packaging and environment problems have never been specific to Python

https://0install.net/ https://modules.sourceforge.net/

amai 4 days ago||
Ironically zero install is pretty difficult to install: https://docs.0install.net/details/macos/
talideon 3/30/2025||
uv has little in common with 0install, which has its origins in RISC OS's application directories.

uv is an attempt to fix the fragments Python development environment tooling story.

krupan 3/31/2025||
I mean yes, you are correct. UV does a lot of different things, but this particular "self-contained app" feature is a lot like zero install. You run your app, its dependencies are automatically downloaded and cached for other uv/zero install apps to use, and it's all transparent and easy.
talideon 3/31/2025||
In this case, it's nothing specific to uv though: there's a PEP outlining how this stuff is declared and uv is just one of the tools that happens to support the format. I wouldn't be at all surprised of pipx also supports it.
amelius 3/30/2025||
So how does this guarantee that it will never raise some libc error, or similar? Unfortunately I have become sceptical about "self contained" distribution methods.
maxerickson 3/30/2025|
This isn't self contained in that sense, it's deferring dependency management to runtime, with uv apparently doing that reliably enough for the use case.
frizlab 3/30/2025||
Hey I have done the same for Swift scripts! (Well I have rewritten what Homebrew’s creator did some time ago, but does not maintain anymore, to be precise.)

https://github.com/xcode-actions/swift-sh

northisup 3/30/2025||
help get this supported in vscode by liking the issue here: https://github.com/microsoft/vscode-python/issues/24916
intellectronica 3/30/2025||
Even better: self-contained uv run python scripts generated by AI: https://everything.intellectronica.net/p/the-little-scripter
bitwize 3/30/2025||
When Python has something akin to Tcl's starkits, then it'll be cooking with gas -- I might even use it again. Py2exe came close, but was not cross-platform.
redsky880 3/30/2025||
Hmmm this seems bad

That code is bad for several reasons including not catching+handling exceptions (and possibly retrying), and accessing the JSON properties w/o get()

The overhead of re-installing stuff and setting up a header seem very unnecessary to run a simple script

If this is about sending some Python for somebody else to run easily - the recipient should always check the code. You should never run arbitrary code. For example, there have been hacks performed using YAML loader (crypto exchange).

For dependencies, use the standard pyproject.toml

Szpadel 3/30/2025|
I do not really understand how this is self contained, when you have to install additional software to run it.

my approach is to use python build-in venv https://gist.github.com/Szpadel/43794d606d9924e7fea3e63fb800...

that way you can run scripts with external packages with only basic python installation

maleldil 3/30/2025|
Your version needs Python. uv needs needs only uv, as it can manage python installation by itself.

It's also a lot easier to install uv than to manage Python installations (there's a reason pyenv and the like exist).

Szpadel 3/30/2025||
That's fair point. Its maybe different use case. For me main goal was to be able to run project scripts on macos and Linux ootb, and both have some python 3 version already available ootb.

But probably if you need specific python version it isn't best way

hacknneyhoffman 3/30/2025||
[dead]
More comments...