r/linuxmasterrace • Lazy Antergos User • Dec 18 '18

Meme Python Virtual Environments: Extreme Advertising Edition

Post image
2.0k Upvotes

148 comments sorted by

View all comments

167

u/ase1590 Lazy Antergos User Dec 18 '18

Also, anyone cluelessly doing sudo pip install anything needs to be flogged.

Virtual Environments are also preferable in order to keep away the Python superfund disaster.

53

u/bbelt16ag Dec 18 '18

I'm a newbie... Sigh

61

u/thejohnd Glorious Red Star Dec 18 '18

Don't worry, soon enough you'll get to experience the joy of borking your python install! Pro tip: DO NOT uninstall python to try to fix it, it will break literally everything lol

25

u/SaphiraTa Glorious Pop!_OS Dec 18 '18

.. Don't uninstall? Why/how does it break and also how do you fix it instead? Lol

55

u/[deleted] Dec 18 '18

i recently tried to do a sudo apt uninstall python on an Ubuntu install, which then lead it to uninstall just about everything on the system, including the desktop environment (gnome).

18

u/SaphiraTa Glorious Pop!_OS Dec 18 '18

Oh wow.. That is interesting lol

23

u/jood580 Dec 19 '18

Just about everything has python as a dependency. So when you trigger an uninstall all programs that depend on python get flagged as well.

I have done this myself, it brakes Linux in an interesting way. For me everything started disappearing from my programs, than gnome changed to default.

So I did the dumb thing and restarted my PC. It then loaded into the command line. I had to reinstall Ubuntu because I could not figure out how to fix it.

Remember kids always have backups and always check what you are removing.

4

u/[deleted] Dec 19 '18

My similar experience was with ibus. Somehow everything depends on it too. Ubuntu 14.04 I think

3

u/superhappyrobots Dec 19 '18 edited Dec 19 '18

Not all distributions break like this, in my experience. The trouble with Ubuntu is that there's a lot of packages included in the ubuntu-desktop meta package. So you remove one (maybe it's a utility that you don't really need, maybe it's a broken Python install) and then suddenly it's trying to remove things from all over the place.

I've never actually looked to see if there are ways around this. I assume that there are. The majority of Ubuntu users I know have got bitten by this at least once, though.

In Manjaro, I was able to uninstall and reinstall dependencies with surprisingly little fuss - so I guess Ubuntu works this way for the sake of being more user friendly overall.

2

u/plsdntanxiety Dec 19 '18

This is where sudo bytes you

2

u/punaisetpimpulat dnf install more_ram Dec 19 '18

"Will break literally everything" He wasn't kidding.

1

u/thejohnd Glorious Red Star Dec 19 '18

Most importantly it breaks apt, which makes it kinda hard to fix things

1

u/SaphiraTa Glorious Pop!_OS Dec 19 '18

Makes sense that makes it hard lol. But why does it break all this other stuff? Are they interconnected somehow i dont know of?

1

u/thejohnd Glorious Red Star Dec 20 '18

I'm not entirely sure. I think Linux uses Python for fetching & parsing web data, but I think there's more to it than that

2

u/Le_9k_Redditor Dec 19 '18

I did this once, never again

1

u/safeness Dec 19 '18

Especially on gentoo. They really try to stop you but it can be done.

1

u/punaisetpimpulat dnf install more_ram Dec 19 '18

I'm about to to embark on that journey... Deep sigh.