Live data from Hacker News

Switching from Pyenv to Uv

bluesock.org

231–239 of 239 posts

Re: Switching from Pyenv to Uv

#231
post #223

Earlier quoted context omitted.

It has nothing to do with redoing venv: some package installs were just taking multiple minutes. I cancelled one at 4 minutes before switching to uv and having it finish in a few seconds

If only linux distributions had existed for decades…

Not sure how a linux distribution replaces python package management but ok?

Re: Switching from Pyenv to Uv

#232
post #11
post #2

has anybody doing complex projects achiever success with uv completely replacing pyenv, and had mostly pros and few or no cons? I'm very comfortable with pyenv, but am extremely open to new stuff

I don't know how complex your project is but I moved my previous work from pyenv to rye(UV and rye have merged, most work is being done on uv, today I'd probably use UV) And am currently trying to move current work to UV. The problems seem to be possibility of unknown breakage for unknown users of the old project not any known technical issue. I'd highly reccomend UV. Its just easier/more flexible. And it downloads t…

thanks, running "uv run x.py" is a relevant downside for me, but you definitely brought me closer to actually looking into it. I'm about to sell a project template and it'd look good if I use a newer tool (as long as I'll make sure it's stable and resilient, the latter being a bit hard to estimate, thus my post)

Re: Switching from Pyenv to Uv

#233
post #2

has anybody doing complex projects achiever success with uv completely replacing pyenv, and had mostly pros and few or no cons? I'm very comfortable with pyenv, but am extremely open to new stuff

Teaching a course for a corporate client this week for data scientists. The first day (of five) we covered uv. Minds blown. "Course was worth it just for uv"

thanks, this encourages me to explore it more

Re: Switching from Pyenv to Uv

#234

UV is such a big improvement that it moves Python from my "would use again if I had to, but would really not look forward to it" pile to my "happy to use this as needed" pile. Without disparaging the hard work by many that came before, UV shows just how much previous tools left unsolved.

It doesn't do anything differently beside the speed... Why do people keep praising it so much? It doesn't solve any of the real problems... come on. The problems weren't the tools, the problems are the bad design of the imports and packaging systems which cannot be addressed by an external tool: the language needs to change.

What are the design problems with the imports and packaging systems? How do they need to change?

Re: Switching from Pyenv to Uv

#235
post #213
post #211

Earlier quoted context omitted.

I end up going to the torch website and they have a nice little UI I can click what I have and it gives me the pip line to use.

That's fine if you are just trying to get it running on your machine specifically, but the problems come in when you want to support multiple different combinations of OS and compute platform in your project.

I could see this information on the website being encoded in some form in pypi such that it could be updated to support various platforms.

Re: Switching from Pyenv to Uv

#236

I highly, highly recommend uv. It solves & installs dependencies incredibly fast, and the CLI is very intuitive once you've memorized a couple commands. It handles monorepos well with the "workspaces" concept, it can replace pipx with "uv tool install," handle building & publishing, and the docker image is great, you just add a FROM line to the top and copy the bin from /uv. I've used 'em all, pip + virtualenv, conda…

uv is great and we’re switching over from conda for some projects. The resolver is lightning fast and the toml support is good. Having said that, there are 2 areas where we still need conda: - uv doesn’t handle non-python wheels, so if you need to use something like mkl, no luck - uv assumes that you want to use one env per project. However with complex projects you may need to use a different env with different bran…

You can create another venv in the same folder with different name. ‘uv venv my-name’ does the thing.

Re: Switching from Pyenv to Uv

#237

I highly, highly recommend uv. It solves & installs dependencies incredibly fast, and the CLI is very intuitive once you've memorized a couple commands. It handles monorepos well with the "workspaces" concept, it can replace pipx with "uv tool install," handle building & publishing, and the docker image is great, you just add a FROM line to the top and copy the bin from /uv. I've used 'em all, pip + virtualenv, conda…

Did you try pixi [1] too? [1] https://pixi.sh/latest/

I have tried Pixi, I was a big fan, but at the time it involved a LOT of manually editing text files & I didn't want to deal with that. And now I have a hard time imagining installing from Conda could possibly be faster than the sheer speed of uv

Re: Switching from Pyenv to Uv

#238

I highly, highly recommend uv. It solves & installs dependencies incredibly fast, and the CLI is very intuitive once you've memorized a couple commands. It handles monorepos well with the "workspaces" concept, it can replace pipx with "uv tool install," handle building & publishing, and the docker image is great, you just add a FROM line to the top and copy the bin from /uv. I've used 'em all, pip + virtualenv, conda…

> It solves & installs dependencies incredibly fast If you are lucky, and you don't have to build them, because the exceptionally gifted person who packaged them didn't know how to distribute them and the bright minds running PyPI.org allowed that garbage to be uploaded and made it so pip would install that garbage by default. > can replace pipx with "uv tool install," That's a stupid idea. Nobody needed pipx in the…

Uv addresses all of your complaints in an elegant way. It's ok if you don't understand its purpose, this list is confusing to me, it's incredibly specific and barely related to uv.

Re: Switching from Pyenv to Uv

#239

Earlier quoted context omitted.

How do you determine where the venv is? AFAIK, uv run in script mode creates the venv in some random temporary directory.

I don’t know of a convenient way of doing it, but a clumsy way of doing it is to run this in your script: import os print(os.environ['VIRTUAL_ENV'] + '/bin/python') Then, e.g. in VS Code, you bring up the command palette, run Python: Select Interpreter , and enter the result.

uv v0.6.10 has just been released with a more convenient way of doing this:

    uv python find --script foo.py
https://github.com/astral-sh/uv/releases/tag/0.6.10

https://docs.astral.sh/uv/reference/cli/#uv-python-find--scr...

Post reply on HN