pip: install package into home directory - always 10 Feb 2017
sudo pip install <package-name>like everybody on the internet tells you to. Use
pip install --user <package-name>. To omit
--user, create a
pip.confas outlined below.
We Rubyists generally don’t install packages via
sudo. We’re not crazy enough
to spill things all over the directories managed by the OS’ vendor.
So, while the Python community will spend 3 more years figuring shit
out set the environment variable
PIP_USER=y or create a pip
~/.pip/pip.conf with the following content:
From now on
pip install <package-name> will always install packages into your
~/Library/Python on macOS) and you can throw shit away easily.
While this should be enough for the occasional python developer consider using
virtualenv (which is equivalent to bundler’s
option) for more complex setups.
And when your OS’s Python version is not enough use pyenv (which is the equivalent to the Ruby version manager rbenv) to run multiple Pythons without conflicts.