[PYTHON] pip> link> Is `sudo pip install` still a broken practice? <How about adding sudo when piping?

Operating environment


Ubuntu 14.04 LTS Japanese Remix

After installing pip, I added sudo to pip install when installing various packages. However, some sources do not add sudo when pip install.

Is it better to put on sudo or not?

I searched. http://askubuntu.com/questions/802544/is-sudo-pip-install-still-a-broken-practice

In short, in accordance with the principle of least privilege, don't use sudo with pip to install Python packages from PyPI unless you absolutely need to. Instead, consider using pip install --user (note that pip install with no sudo nor additional flags/options defaults to pip install --user on Ubuntu currently) or virtual environments (such as virtualenv). If you see people recommending sudo pip or sudo -H pip, please tell them not to.

(Addition) I read the above document and did pip install without sudo, but I encountered several situations where I couldn't install successfully. After all, I'm doing pip install with sudo.

I'm still not sure.

Recommended Posts

pip> link> Is `sudo pip install` still a broken practice? <How about adding sudo when piping?
A note when gcloud is broken
How about creating a virtual environment with Anaconda and doing pip install?
Pip install a private repository when building Docker
sudo pip install
I got a UnicodeDecodeError when pip install on ubuntu
A memorandum when an error occurs with pip install