Most recently tested on macOS Sierra (10.12.6)
- Download the installation script;
curl https://bootstrap.pypa.io/get-pip.py -o ~/Downloads/get-pip.py
- Run the installation, appending the
--user
flag;python ~/Downloads/get-pip.py --user
. pip will be installed to ~/Library/Python/2.7/bin/pip - Make sure
~/Library/Python/2.7/bin
is in your$PATH
. Forbash
users, edit thePATH=
line in~/.bashrc
to append the local Python path; ie.PATH=$PATH:~/Library/Python/2.7/bin
. Apply the changes,source ~/.bashrc
. - Use pip! Remember to append
--user
when installing modules; ie.pip install <package_name> --user
There is much discussion about making the user site the default for installation. See Issue 1668.
after removing pip from /usr/local/bin and from anaconda3 I tried the above operation 1 & 2
however, this did not entirely solve the problem.
Running pip caused the following error
-bash: /Users//anaconda3/bin/pip: No such file or directory
To get this to work I had to do
sudo easy_install pip
Now it works.
The thing is - prior to doing steps 1 & 2 easy_install was causing a problem with pip
ImportError: cannot import name 'version' from 'pip' (unknown location)
??