I\'ve been trying to install pip on macOS sierra via brew, but every time it completes without installing the binaries in /usr/local/Cellar/python/2.7.13/bin
.
For what it's worth, after upgrading to high sierra I found my machine pretty much unusable for development, even crashing plenty of times.
Regarding python, i had a rights issue inside the site-packages folder, therefore the reinstall did not work out:
$ brew reinstall python
==> Reinstalling python
==> Downloading https://homebrew.bintray.com/bottles/python-2.7.14.high_sierra.bottle.tar.gz
Already downloaded: /Users/m/Library/Caches/Homebrew/python-2.7.14.high_sierra.bottle.tar.gz
==> Pouring python-2.7.14.high_sierra.bottle.tar.gz
==> /usr/local/Cellar/python/2.7.14/bin/python2 -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --install-scripts=/usr/local/Cellar/python/2.7.14/bin --install-
Last 15 lines from /Users/m/Library/Logs/Homebrew/python/post_install.01.python2:
.
.
.
copying build/lib/setuptools/script (dev).tmpl -> /usr/local/lib/python2.7/site-packages/setuptools
copying build/lib/pkg_resources/_vendor/packaging/version.py -> /usr/local/lib/python2.7/site-packages/pkg_resources/_vendor/packaging
error: could not delete '/usr/local/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/version.py': Permission denied
Warning: The post-install step did not complete successfully
...
So to fix it, I completely removed the site-packages:
$ sudo rm -rf /usr/local/lib/python2.7/site-packages
With this, reinstalling python2, and having a working pip2 again, worked like a charm:
$ brew reinstall python
$ which pip2
/usr/local/bin/pip2
$ which python2
/usr/local/bin/python2
$ which pip
pip not found
$ which python
/usr/bin/python
Hope that helps.