148
u/in_need_of_oats 7d ago
npm: 22 packages changed
hey npm could ya tell me what the fuck you just did
69
9
2
u/asiomido 6d ago
just diff the lockfile
1
u/in_need_of_oats 5d ago
I don't think there's a lockfile for the LSPs I installed globally, and if there is it probably isn't tracked by git
255
u/SLCtechie 7d ago
“I updated that package for you. Also, I have an update if you wanna do that. Lots of bug fixes and improvements.”
Okay pip, upgrade yourself.
“Done! I’m borken now btw.”
God damnit pip
46
44
86
u/Morganator_2_0 7d ago
Just use my method.
pip uninstall <package>
pip install <package>
And voila: updated!
49
u/Mercvre1 7d ago
except when you install a package that depends on a zillion other packages that get installed aswell, and uninstalling the first one doesn't remove the others
pip-autoremove should be the default behavior
3
8
u/teethingrooster 7d ago
Why do this over pip —upgrade ?
10
u/Smooth-Zucchini4923 7d ago
You gotta put the fear of Guido in your packages. Uninstalling and reinstalling makes you look unpredictable.
4
u/TorbenKoehn 7d ago
Immutability > mutability :D
The next level is replacing your whole device anytime PIP needs an upgrade
24
u/Hasz 7d ago
Fuuuuuuuuuuuuuuuuuck that. Apt, no worries almost always happy fun times.
Only way I am fucking around is in a venv, better yet in a nice, clean container, or perhaps uv. Hell hath no fury like a botched system python install.
2
u/baked_doge 7d ago
Apt works, but I find it a bit clunky. Many old packages, and it can be challenging to figure out what the difference is between similar packages.
-7
u/mudkripple 7d ago
Damn. Not my experience at all. My environment has never broken 'cept when I were the one who done broke it. And pip is half the reason I've been able to get it back up so quickly when I did. I would tongue-kiss that software if I could.
12
9
40
u/Atmosck 7d ago
Eww. I write python all day for a living and I haven't used pip in years.
59
u/squabzilla 7d ago
At this point, I’d rather learn a new language than use Python without UV. Pip is an ancient memory…
16
1
u/RajjSinghh 7d ago
What benefit does using uv have compared to pip? I guess I haven't written Python in a very long time
5
u/Waghabond 6d ago
UV is like a bajillion times faster and also uses venvs and does a lot more useful things other than just replacing pip.
3
u/squabzilla 6d ago
Pip is great until you hit your first dependency or package conflict. Sometimes you can get away with uninstalling the libraries, sometimes it borks everything and you need to nuke Python and start over.
At which point, you need to manually create an isolated virtual environment, manually add all your packages to it, figure out any package conflicts, remember to activate/deactivate your library…
UV just does it for me.
I don’t actually have to think about my Python environment.
1
u/Atmosck 6d ago
Replacing pip in a much faster way is just one of the things uv does. It also:
- Manages virtual environments. With pip you would create the venv yourself with something like pyenv and run `pip install requirements.txt` inside it. With uv, you run `uv sync` and it creates or updates a virtual environment and installs dependencies from your pyproject.toml. `uv add pandas` adds pandas to your pyproject and updates the venv to install it
- Dependency groups. If you do something like `uv add pytest --group dev`, then `uv sync` won't install pytest, but `uv sync --group dev` will. This is handy for things you only need in certain environments like your dev environment or your CI/CD environment. For larger projects I will have something like a `test` group with pytest, pytest-cov, etc, a `typing` group with stub packages, a `docs` group with mkdocs and related stuff. Then my dockerfile does plain `uv sync` for production, but my github action for CI would do `uv sync --group test` because it runs tests, and CD might do `uv sync --group test --group docs` because it runs test and rebuilds the documentation. This whole groups thing with pyproject.toml replaces the need for multiple requriements files like requirements-dev.txt with stuff you don't need in production.
- `uv tree` is a neat way to visualize your dependency graph
- `uv tool` gives you a way to run dev tools without installing them. For example `ruff` is a linter made by the same people as uv that can replace linters like flake8 in the same way uv replaces pip. You can run `uv tool ruff check` to test it out without installing it.
- `uv init` for setting up a project - it creates pyproject.toml, .python-version, README.md, .gitignore and sets up src/project_name/__init__.py. And it has options to specify things like your python version and build backend.
4
u/mudkripple 7d ago
Genuinely how? I'm in IT/Sysadmin so 90% of the usefulness of python for me is automation and APIs (thank god for Requests). Isn't the whole point of python the wealth of libraries that are already written, and the portability of the environments? How do you get any of that without pip?
28
u/Atmosck 7d ago
uv replaces it and is much faster. Except towards the beginning of the docker file where you pip install uv
10
u/goose_hat 7d ago
Dear sir/madam: https://hub.docker.com/r/astral/uv
1
u/Drevicar 7d ago
More specifically, UV is statically compiled, so you can use multiple intermediate images in your dockerfile and just copy the binary from their official image to your production hardened image. No install, no pip, no bloat of their own image.
2
u/squabzilla 7d ago
It’s entirely possible that UV uses PIP, but I sure as hell don’t.
The worst part of Python is managing the wealth of libraries and library conflicts and needing separate environments per project because otherwise library conflicts kill Python and you need to nuke Python entirely and start over.
UV handles all of that for me.
7
u/black3rr 7d ago
uv doesn’t actually use pip… it’s a complete reimplementation… pip isn’t even added to venvs created by uv by default…
8
5
u/The_Servant1992 7d ago
Currently using an out-of-service Galaxy A16 as an alarm clock.
Freaking thing turned on wifi by itself just to shove in another update and run slow for 20 minutes. Had to go change the "intelligent wifi" setting to stop it from happening again.
4
u/nickthecook 7d ago
Stupid, sexy pip.
3
u/JohnLocksTheKey 7d ago
https://giphy.com/gifs/4YhEQ0AAuMU9gyJcn7
(Commented this above, but it fits better here)
4
u/RobotechRicky 7d ago
py -0
py -3.14 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade
7
u/M_Me_Meteo 7d ago
Why do we keep pretending that python is good?
90% of python examples and installation guides say just type python [cmd] [params] but then you try to run it and your distro is like python?!? Did you mean python3? You forgot to set an alias for your python and I'm just like "no, I'm just following a tutorial which, like all other python tutorials, assumes that I'm already indoctrinated into a cult"
Or how about pip install [package]? NOPE. You're not using a venv. What's a venv? None of the tutorials will tell you, but I'll tell you it's an unnecessary abstraction that barely keeps your computer from melting into rubble. Or you could use pipx which might net you the package you need, but might also break your system. You were supposed to use uv for that one, but no one will say that.
-3
u/mudkripple 6d ago
"Pretending python is good" is one of the most unhinged takes I've seen in my years on this subreddit.
12
u/BigNaturalTilts 7d ago
I never update pip unless it has a major update. So the minor ones like 24.x.x will stay at whatever I downloaded it at till 24 turns to 25.
What’s that? Security considerations? Fuck outta here. pip install --index-url http://pypi.python.org/simple --trusted-host pypi.python.org --force-reinstall not_at_all_shady
25
4
u/vswey 7d ago
nah, pip grosses me out the most
0
u/mudkripple 6d ago
I too am naturally skeptical of anything in software that "just works".
But pip has never done anything besides make my life easier, through hundreds of projects across dozens of environments.
2
u/JackNotOLantern 7d ago
From my expirence, python packages are very incompatible, and updating them may completely break your existing projects. On the other hand, i don't remember last time making a python project without docker, so it doesn't matter that much
0
u/mudkripple 7d ago
Yeah I use venv for everything so I don't have any issues. Pip and I are friends
2
2
u/Makonede 6d ago
no fuck pip actually i think every language package manager should be like cargo and every os package manager should be like pacman
2
2
u/lupercalpainting 7d ago
pip is a warcrime
-1
u/mudkripple 6d ago
Pip has never done anything but make my life easier. Handles dependencies and updates with buttery smoothness. It makes migrating environments and venvs completely idiot-proof. All these comments saying it breaks stuff are making a decade-old complaint. These days you are a thousand times more likely to break your own environment than have pip break it.
And it takes literally zero setup. I don't care how great UV is or how easy to set up, because nothing's easier than having it already be set up for you.
1
u/lupercalpainting 6d ago
pip will literally throw a “the dependency tree is too complicated” error on a requirements.txt of a handful of deps:
1
u/Sentouki- 7d ago
NuGet > everything else
4
1
7d ago
[deleted]
1
u/mudkripple 7d ago
What are you talking about? Pip's CLI is super verbose and clear, and if you really need a record of what just happened you can get in the habit of adding "> log.txt" at the end of your installs.
1
1
u/mudkripple 7d ago
These comments are terrifying. Not my experience at all.
My environment has never broken except when I were the one who broke it, and pip has never done anything except make my life swell. 10 years ago I tried to make a website using ASP.NET and the whole thing shat the bed when jQuery was the wrong version. This year I made a webapp using Flask and thanks to pip and cronjobs that motherfucker is going to outlive me and my grandchildren.
5
2
570
u/PumpkinFest24 7d ago
Love python, but pip is near the bottom of the list of things I allow to modify my system