Global Package Installation With Pip

Pip has really made management of packages in a Python installation much less frustation free, though some glitches/annoyances remain. One issue I’ve found is that it is actually a little complicated to install packages modules systemwide for all users. This is the opposite of the situation in life before Pip, where it could be incredibly painful to not have system-level privileges and use global/systemwide targets when installing packages. Definitely progress, as the the “local user ecosystem” target is definitely a more useful and more common objective. Nonetheless, if you do need or want to use Pip to install packages for all users, turns out you have to switch to the root user, go to the root directory, run umask to make sure that file permissions for all files created in the next step are going to be correct, and then run pip:

$ sudo su
# cd ~
# umask 022
# python3 -m pip install git+https://github.com/jeetsukumaran/DendroPy.git@development-master

By the way, for the other 99.99999% of time, when you are interested in just running/managing various local Python installations, here is a tip: Anaconda.

Share