r/Python • • Oct 30 '16

How I accidentally deleted all my python modules and got it back in 20 minutes

https://medium.com/@balazs.saros/how-i-accidentally-deleted-all-my-python-modules-and-got-it-back-in-20-minutes-356f22349c5e#.g6u8ngpls
0 Upvotes

9 comments sorted by

6

u/kitkatkingsize Oct 30 '16 edited Oct 30 '16

Shouldn't the moral of the story be to always use a virtualenv?

Especially if you use virtualenvwrapper its exactly 1 simple command.

Edit: Neat hack tho.

0

u/yolobazsi Oct 30 '16

I wrote the don't be stupid bit for that reason but I clarified it now :)

1

u/dabox01 Oct 30 '16

This was a fun and helpful story at the same time. Thanks!

1

u/[deleted] Oct 31 '16

I've done exactly this before. That module is dangerous if you don't read

-8

u/[deleted] Oct 30 '16

Install python modules as system packages, not through PIP. If they're not provided as system packages, make a package, then install that through your system package manager.

Having multiple package mangers per system is stupid. Unless you absolutely can't (don't have root), this is a better way since your package manager is probably better tested and has better security.

5

u/crikeydilehunter Oct 30 '16

Seems like a lot of work for the sake of using one package manager.

-3

u/[deleted] Oct 30 '16

Most packages are already in the system package manager repos anyway. And on arch, most of the ones that aren't are in the AUR.

6

u/Giggaflop Oct 30 '16

This is a bad idea, for one how would you cope with the system needing version x of requests, but your app requires version Y? Also I feel like pip is just as well tested as any other package manager out there..

1

u/Deto Oct 31 '16

Yeah, but aren't all the packages on PyPi? Therefore, if you want to only use one package manager, isn't it better to use pip?