close

[Solved] ImportError: No module named pip in macOS

Hello Guys, How are you all? Hope You all Are Fine. Today when I run the pip command it gives me ImportError: No module named pip in macOS Python. So Here I am Explain to you all the possible solutions here.

Without Wasting your time, Lets start This Article to Solve This Error.

How ImportError: No module named pip in macOS Error Occurs ?

I have freshly installed python in my macOS. Now I am trying to install pip in my mac. But pip install, the error message showed like that.

ImportError: No module named pip

How To Solve ImportError: No module named pip in macOS?

Question: How To Solve ImportError: No module named pip in macOS Error?
Answer: To Solve ImportError: No module named pip in macOS If You are using python3 then Run this command to install pip in macOS: sudo apt-get install python3-pip and If You are using python2 then Run this command to install pip in macOS sudo apt-get install python-pip.

Solution 1

If You are using python3 then Run this command to install pip in macOS.

sudo apt-get install python3-pip

If You are using python2 then Run this command to install pip in macOS.

sudo apt-get install python-pip

This solution solved my error.

Solution 2

If you are mac user then On Mac using brew is a better option as apt-get is not available. Command:

brew install python

In case you have both python2 & python3 installed on machine

python2.7 -m ensurepip --default-pip

OR

python3 -m ensurepip --default-pip

If instead you are missing pip from python 3 then simply change python2.7 to python3 in the command above.

Solution 3

In my macOS 10.15 and Homebrew 2.1.6. I just needed to run:

python3 -m ensurepip

Now python3 -m pip works for me.

Solution 4

After installing ez_setup, you should have easy_install available. To install pip just do:

easy_install pip

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment