re: Dead Simple Python: Virtual Environments and pip VIEW POST


Awesome! Quick question tho on sudo pip. I've had encounters before with it.

Why is it wrong,
and what happens if you do do it,
and how do you "undo" such an action?


It's not exactly wrong, it might not do what you are expecting.
People might run pip install requests and fail because of permissions. They might try sudo pip instead of pip install --user.

Sudo pip will install things in the system's python, rather than the user's python.


Ah! That makes sense. So it would be much better then to do pip install --user than sudo?

Yes, or if you want a ditectory/project dependencies, use a virtual environment


Good explanation, @jcsvveiga .

The reason I say you should "never" use sudo pip is, on any system maintained by a dedicated package manager, it can easily conflict with the system-maintained packages, which can make a real mess, especially where dependencies are concerned.

code of conduct - report abuse