←back to thread

Using uv with PyTorch

(docs.astral.sh)
167 points charliermarsh | 1 comments | | HN request time: 0.274s | source
Show context
alex_suzuki ◴[] No.42192428[source]
In a nutshell, what do I gain from switching to uv from my current workflow, which is: 1) create a venv (`python3.xx -m venv venv`) 2) install packages from a requirements.txt into that venv?

One limitation I know of are the inability to detect stale packages.

Apart from „blazing fast“, which I‘m not convinced it really matters to me as I rarely touch the dependencies, what are the main reasons why uv is gaining traction?

replies(4): >>42192436 #>>42192507 #>>42192711 #>>42198294 #
infamia ◴[] No.42198294[source]
You might gain a couple of things...

No need to activate venvs and the almost inevitable Python pathing "murder mysteries". uv installs in venvs first, and only then someplace else (e.g., globally).

No more clunky typing `python -m pip install foo` even when you have activated your venv (or you think you have). `uv pip install foo` is nicer and easier to remember.

uv add will add new dependencies to your pyproject.toml so you don't have to.

uv can setup skeletons for new projects in a nice, modern way

For older projects, you can have uv to resolve dependencies as of a certain date. I imagine this is great for older projects, especially with numerous dependencies.

It might remove the need for pyenv or the need to rely on your system provided Python, since uv can install Python for your project.

Cross-platform lock files

I've just started looking in to uv, so maybe my list isn't complete/very good. Some down sides include, it's still green (has some bugs naturally and lacks some features) and some might not trust/like that it's VC backed.

replies(1): >>42212940 #
1. alex_suzuki ◴[] No.42212940[source]
> For older projects, you can have uv to resolve dependencies as of a certain date. I imagine this is great for older projects, especially with numerous dependencies.

Interesting. I imagine this is a selling point for corporate environments.