Why should I type `sudo` before every pip install?

When installing packages registered as my username, I always get permission if I do not:

sudo pip install.

How can I do this so that it is not necessary? Or should it be so?

+4
source share
1 answer

Either I will use virtualenv as indicated in the comments on the question, or use python PYTHON_USERBASE to install modules only for your user:

In your .bashrc add:

export PYTHON_USERBASE=~/python_userbase

then download your package, extract it, go to the resulting directory and run:

python setup.py install --user

or just use:

pip install <package> --user

~/python_userbase/lib/pythonXXX/site-packages -

:

pep-0370

, , Unix, /etc/sudoers pip root. .

+8

All Articles