Skip to content Skip to sidebar Skip to footer

Pip3 Gone After Hombrew Upgrade

I upgraded my outdated packages with brew upgrade, but now I find that the pip3 command (pip for Python 3) that I previously had is gone. My Python 3.6 installation is still there:

Solution 1:

You need to decide how you want it to work and homebrew can then accommodate you. The information is available if you run:

brew info python

Python has been installed as /usr/local/bin/python3

Unversioned symlinks python, python-config, pip etc. pointing to python3, python3-config, pip3 etc., respectively, have been installed into /usr/local/opt/python/libexec/bin

If you need Homebrew's Python 2.7 run brew install python@2

Pip, setuptools, and wheel have been installed. To update them run pip3 install --upgrade pip setuptools wheel

You can install Python packages with pip3 install They will install into the site-package directory /usr/local/lib/python3.6/site-packages


So:

  • if you want to use versioned commands, i.e python3, pip3 and idle3, put /usr/local/opt/python/bin at the start of your PATH:

    export PATH=/usr/local/opt/python/bin:$PATH

  • if you want to use un-versioned commands to mean Python3 and its tools, i.e.python, pip and idle, put /usr/local/opt/python/libexec/bin at the start of your PATH:

    export PATH=/usr/local/opt/python/libexec/bin:$PATH

  • if you want to use the (ancient) Python v2.7 supplied by Apple as part of macOS, put /usr/bin at the start of your PATH, and use the command python:

    export PATH=/usr/bin:$PATH

Solution 2:

They changed the default commands in the Homebrew package for Python 3 to be python3 and pip3 to be compliant with PEP 394.

If pip3 doesn't work I'd try reinstalling Python: brew reinstall python.

brew install python installs Python 3 (and pip) since Homebrew 1.6.0.


The error in the output for brew reinstall python that you posted says that /usr/local/lib/python3.6/site-packages/pkg_resources/__init.py__ cannot be deleted because of lacking permissions.

Have you checked the permissions of that file and verified that you have write permissions on it?

If not, you can add write permissions with

chmod u+w /usr/local/lib/python3.6/site-packages/pkg_resources/__init.py

and then try again.

Post a Comment for "Pip3 Gone After Hombrew Upgrade"