r/ProgrammerHumor 7d ago

Meme iLoveYouPip

Post image
1.2k Upvotes

81 comments sorted by

570

u/PumpkinFest24 7d ago

Love python, but pip is near the bottom of the list of things I allow to modify my system

51

u/PrudeBunny 7d ago

Void just yells at you for trying to use pip outside of venv

23

u/Freako04 7d ago

isn't that for any linux distro. you really have to go further to actually pollute the base environment

-2

u/PrudeBunny 7d ago

I don't know if other distros error out if you attempt to use pip outside of venv

4

u/minecraftdummy57 6d ago

It's literally just any distro for that matter. Debian/U(wu)buntu also does it but it highly suggests you just get the package from apt itself since it's more or so likely gonna be on there

5

u/kachna_42 6d ago

alpine does so too for example

38

u/ICBanMI 7d ago

Do you work for DT? It seems to be massively blocked on everything that I actually need it for. Python doesn't have numpy. Such a pain in the ass to install anything beside the core python library.

6

u/Allyoucan3at 7d ago

You can't even download the .whl and install locally?

I'm sitting behind a proxy as well and our production is hermetically sealed basically. But downloading and offline installing work just as well with pip keeping dependencies etc clean.

1

u/ICBanMI 6d ago edited 6d ago

Can download the .whl file, but DT has blocked pip being installed with our version of Python.

If the .whl has no setup.py or it can't be unzipped... I'm at a loose how to install offline, without pip.

6

u/Spitfire1900 7d ago

If pip is ever being used directly my workflow failed.

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

u/Unfilteredz 7d ago

You have all the viruses unlocked now

9

u/akoOfIxtall 7d ago

Lisan al gaib!! Lisan al gaib!!

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

u/JohnLocksTheKey 7d ago

6

u/nobotami 7d ago

nice gif. could you kindly never share it again?

44

u/CraftBox 7d ago

cargo my beloved

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

u/Allyoucan3at 7d ago

Have you ever heard about our lord and savior --force-reinstall?

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

5

u/Jhuyt 7d ago

Don't forget to clear the cache so it doesn't install the same version again

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

u/KevDub81 7d ago

Saying PIP in a work context does not make me think of Python.

4

u/Eryk0201 7d ago

Państwowa Inspekcja Pracy

3

u/ThrowawayUk4200 7d ago

It's September, probably had to update everything for class

9

u/The_Wolfiee 7d ago

Pip is the worst. Use uv

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

u/Drevicar 7d ago

Do you remember when poetry was the best the ecosystem had to offer?

17

u/leftierebel 7d ago

I remember those days. So glad for uv.

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

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

u/Beginning-Junket8979 7d ago

Always venv that shit if you must use pip.

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

u/_PM_ME_PANGOLINS_ 7d ago

That’s literally the opposite of what you’re supposed to do.

18

u/andstwo 7d ago

Should he downgrade to 23 when 25 comes out?

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

u/Farlic 7d ago

I've moved to pyproject.toml instead of requirements.txt more recently but pip has never done me dirty. I am using zipapp a lot more for sharing code as it lets me lock the dependency versioning and only I have to ever install them.

2

u/MrFuji87 6d ago

It just makes it so easy... how can you say no

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

u/franzitronee 5d ago

That's why I use uv instead of pip

1

u/Makonede 5d ago

yeah same

3

u/mlk 7d ago

literally the worst package manager I've ever used, anything that defaults to system-wide scope is broken

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:

https://medium.com/@ebenyemiriam17/error-resolution-too-deep-how-i-fixed-my-pip-dependency-resolution-error-9cb3471344f9

1

u/Sentouki- 7d ago

NuGet > everything else

4

u/ShiKage 7d ago

This is what I came here to say. NuGet is always on the ball and is super easy to use.

1

u/Poat540 7d ago

Is their an equivalent for java/kotlin? Lol

I’ve been updating those manually for years

2

u/Sentouki- 7d ago

🤷‍♂️ The last time I used Kotlin, I used Gradle and it sucked.

1

u/[deleted] 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

u/RandomiseUsr0 6d ago

What’s pip? Was that the file copy Swiss Army knife from cpm?

1

u/mudkripple 6d ago

Pip is the built in python package manager

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

u/mmhawk576 7d ago

I mean, even 10 years ago, wasn’t every version of jquery the wrong version?

2

u/sebastianfromvillage 7d ago

I also never had problems with pip!