What is the purpose of "pip install --user ..."?

Rob Truxal picture Rob Truxal · Mar 24, 2017 · Viewed 232.3k times · Source

From pip install --help:

 --user      Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%\Python on
             Windows. (See the Python documentation for site.USER_BASE for full details.)

The documentation for site.USER_BASE is a terrifying wormhole of interesting *NIX subject matter that I don't understand.

What is the purpose of --user in plain english? Why would intalling the package to ~/.local/ matter? Why not just put an executable somewhere in my $PATH?

Answer

duskwuff -inactive- picture duskwuff -inactive- · Mar 24, 2017

pip defaults to installing Python packages to a system directory (such as /usr/local/lib/python3.4). This requires root access.

--user makes pip install packages in your home directory instead, which doesn't require any special privileges.