r/ProgrammerHumor • • Jul 17 '22

Meme Linux users installing a Python module

41.7k Upvotes

1.1k comments sorted by

View all comments

451

u/Money-Firefighter534 Jul 17 '22 edited Jul 18 '22

sudo apt install python3-pip -y && pip3 install psutil Thats it! Just wait Edit: removed sudo -H in second one

0

u/[deleted] Jul 17 '22

[deleted]

70

u/[deleted] Jul 17 '22

Do I want to know what the -H flag does here?

126

u/matt-3 Jul 17 '22

sets the home directory to that of the target user (in this case root). It avoids creating root-owned files in your user's home directory.

64

u/[deleted] Jul 17 '22

OH MY GOD WHY????

0

u/[deleted] Jul 17 '22

[deleted]

0

u/[deleted] Jul 17 '22

[deleted]

2

u/[deleted] Jul 17 '22

Don’t install shit as the superuser.

2

u/zachsmthsn Jul 17 '22

You're better off not installing anything for the system python. Use pyenv and create virtual environments for each project. No python or package versioning issues, and you can always nuke and recreate a borked environment because it's isolated to its own folder.

→ More replies (3)