Hacker News new | ask | show | jobs
by chowells 8 days ago
I think the biggest win of going from pip to uv is that breaking your python environment no longer breaks the tool to manage your python environment. Pip was always fragile in that you could carelessly use it to break a library it is depending on. (Yes, there are ways to avoid that - but they require not being careless.)
1 comments

I once, on a fresh Ubuntu install, did "apt install python-pip3", and then "apt install python3.8" when I realized I actually needed Python 3.8. The pip3 complained that it was outdated and suggested a command to run to update it. Naturally, I ran it, and it completely broke apt, it couldn't even do "apt list" never mind intalling/removing packages, so I had to rollback the VM to fix this bullshit. Wonderful, 10/10 DevEx.
I'm not sure that's a compelling indictment of Python specifically, but you definitely make a good case for tools that are often needed as prerequisites for using other tools (package managers, decompressors, the basic drivers needed for HID, slow networking, VESA graphics, storage) being distributed in a self-contained way.

I'm not necessarily a "statically link all the things" zealot, but I think that pattern definitely has a place where problems like yours often occur.

Well, Ubuntu (and Debian) definitely have a fair share of blame for both weirdly insisting on packaging parts of Python standard library into separate apt packages, and also on setting the system-wide Python in such a way that packages from different Python versions will end up in the same site-packages/ directory, and also on making apt rely on system-wide Python which can be very easily broken by apt itself... tl;dr is that the only sane way to use Python on Ubuntu is to immediately get virtualenv (yes, it's too distributed separately from Python itself, you need to run "apt install python3-virtualenv" first) — and then never, ever touch system-wide Python or its packages with apt, upgrade the pip inside your venvs only.
Or install uv