Error running "pip install." How can I fix it?

Error running “pip install.” How can I fix it ?

Hiii Klyani,

For Ubuntu, you can install pip for Python 3 with:

sudo apt install python3-pip

And for Python 2, use:

sudo apt install python-pip

@Joe Elmoufak the question is about installing on Mac. For installing pip on macOS v10.15 (Catalina) with Homebrew 2.1.6 and Python 3.7, you can resolve the error by running:

python3 -m ensurepip

After running this command, you should be able to use python3 -m pip successfully.

Hey Klyni,

On macOS, using Homebrew (brew) is recommended over apt-get as apt-get is not available on macOS.

To install pip for Python, you can use Homebrew with the following command:

brew install python

If you have both Python 2 and Python 3 installed on your machine, you can ensure pip is installed for Python 2 with:

python2.7 -m ensurepip --default-pip

If you need pip for Python 3, you can use:

python3 -m ensurepip --default-pip

This should resolve any pip-related issues you’re facing.