Even if you are not into Python
there comes a time when you end up with the need of having to install pip
on your macOS or OSX-based computer.
Searching online would lead you to long tutorials which are not really what you need. In this post, I’ll give you multiple one-line solutions based on your version of Python installed.
If you have the default version of Python on macOS (v2.7 as of 2021).
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python
If you have Python v3 installed as python
, run this:
curl https://bootstrap.pypa.io/get-pip.py | python
Or if you have it installed as python3
run the following:
curl https://bootstrap.pypa.io/get-pip.py | python3
That’s about it. Have fun. Check out my courses โ could be fun.
๐ Check out my new course โ NodeCLI.com build any kind of automation software and do with Node.js and JavaScript. Easily my best course ever.
I’ve just launched a course called VSCode Power User โ Check out why I worked ridiculously hard for 1.5 years and 1,000+ hours building, recording, sharing 200+ dev tips in this VSCode.pro course!
The explanation#
โ ๏ธ easy_install
has been deprecated in 2019.
easy_install
has been deprecated. Please use get-pip.py
instead.
Step #1 โ First of all download the get-pip
file by running:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Step #2 โ Now run this file to install pip
python get-pip.py
That should do it. Make sure you run this with Python 3.X as this doesn’t work for Python 2.X. If you want to upgrade to Python 3 check out this post.
Another gif you said? Here ya go!

Old Method (doesn’t work anymore)#
โน Now, all you have to do is run the following command.
sudo easy_install pip
After thatpip
will be installed and you’ll be able to use it for installing other packages.
Let me know if you have any problems installing pip
this way.
๐ Check out my new course โ NodeCLI.com build any kind of automation software and do with Node.js and JavaScript.
I’ve just launched a course called VSCode Power User โ This is easily my best work ever. Check out why I worked ridiculously hard for 1.5 years and 1,000+ hours building, recording, sharing 200+ dev tips in this VSCode.pro course!
Perfect! thank you.
Glad it helped!
Thanks. It worked like charm.
Glad it helped!
Hi
I manage to install PIP on my Mac. Then I wated to instal virtualenv and ive got this message :
Did you try using
sudo
looks like a permission error.Had been struggling with the tutorials for installing pip as provided by amazon to support aws. And it wasn’t working. Followed your 2 easy steps and I now have pip in my mac. Thanks a lot.
Hah! Glad I could help. I should do more such short posts, to the point to help devs with common frustrations.
Worked thank you :)
Thanks dude!
Hey. My command line is asking for a password. What do I do from here?
Oh, use the password you use to log in to your Mac. That’s the one.
Simples.lol! I love it. Thanks, I was having trouble using another tutorial.
Glad I could help.
HI Ahmad, This is my first time trying to use Python. So, I have to need a lil help to setup its environment.
While trying Installing pip, It is showing error below
Sairas-MacBook-Air:~ adnan$ sudo easy_install pip
Password:
Sorry, try again.
Please guide me how can i resolve this issue?
Sorry, I read your previous comments now, It worked :) Thank you for the great article. You’re always my inspiration. Keep doing good work and Stay blessed
Thank you,
Glad you liked it! ๐ฏ
when i do this its asking me password .
the exact content displayed is
we trust you have received the ususl lecture from the local system
administrator. It usually bols down to these three things:
#1)respect the privacy of others
#2)think before you type
#3)with great power comes great responsibilty
sorry ! i read your previous comments and gave the password.
I get prompted with the Password but it wonโt let me type anything. I even tried changing my password but to no effect. I can press enter but it says sorry, try again.
Would sincerely appreciate it if you helped me with this.
Thanks!
Haha, it’s not supposed to show you anything when you are typing. So, just run the command again, when it asks for your password, just type in your pass (no *** representation there). When you’re done, press Enter.
Sorry for stupid question, but what password is it taking us to enter??
Enter the password you have for your Mac. The master pass you use to access your mac or the admin password that you enter for your profile.
Thank you so much .I was breaking my head for the past 3 hours . i am able to do it now !!
Glad I was able to help. ๐ฏ
Worked like a charm. Thanks!
Thanks! Just what I needed!
Yay!!! ๐
I want to install pip for python 2.7 on my Mac. I think this is the python located in /usr/bin/python. Unfortunately I have already installed Anaconda, which installs python 3.6.3, and changes things so that the command python xxx.py automatically runs xxx.py using python 3.6.3. I added the alias python2=/usr/bin/python, so now the the command python2 xxx.py runs xxx.py using python 2.
The command python –version returns Python 3.6.3 :: Anaconda custom (64-bit), and the command python2 –version returns Python 2.7.10.
I tried sudo easy_install pip, but it installed pip in the Anaconda python 3.6.3 folder. What should I do to install pip in the correct place?
Thanks very much!
awesome, quick and just works. I wish a lot more tutorials were like that for small easy tasks
Glad you liked it! ๐
I tried installing pip, but I got this error message:
Traceback (most recent call last):
File “/usr/local/bin/easy_install”, line 5, in
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
Any ideas? I have both Python 2.7.10 and 3.6.4 installed on Mac OSX.
Never mind, with some more digging I was able to figure it out.
how did you get pip? im having the same problem
Hi Ahmed,
I try to install pip for python 2.7 on my Mac. But I have got this error:
Searching for pip
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: EOF occurred in violation of protocol (_ssl.c:590) — Some packages may not be found!
Couldn’t find index page for ‘pip’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: EOF occurred in violation of protocol (_ssl.c:590) — Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse(‘pip’)
I use R for writing my codes, I m not a python user. Would appreciate it if you help me with this!
Best,
I have two versions (python 3.6.1 and python 2.7):
/Library/Python/2.7/site-packages/
I m login as admin but it still display:
[Errno 13] Permission denied: ‘/Library/Python/2.7/site-packages/test-easy-install-19065.pth
I’m not fine with that!!
Hi,
I get this error:
Error: Python module keras was not found.
Detected Python configuration:
python: /usr/bin/python
libpython: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib
pythonhome: /System/Library/Frameworks/Python.framework/Versions/2.7:/System/Library/Frameworks/Python.framework/Versions/2.7
version: 2.7.10 (default, Feb 7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
numpy: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
numpy_version: 1.8.0
keras: [NOT FOUND]
python versions found:
/anaconda2/envs/r-tensorflow/bin/python
/usr/bin/python
/usr/local/bin/python3
What can I do?
Hello, I get an error. Can you please help!
sudo easy_install pip
Traceback (most recent call last):
File “/usr/local/bin/easy_install”, line 11, in
load_entry_point(‘setuptools==33.1.1’, ‘console_scripts’, ‘easy_install’)()
File “/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py”, line 357, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py”, line 2394, in load_entry_point
return ep.load()
File “/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py”, line 2108, in load
entry = __import__(self.module_name, globals(),globals(), [‘__name__’])
File “build/bdist.macosx-10.10-intel/egg/setuptools/__init__.py”, line 10, in
File “build/bdist.macosx-10.10-intel/egg/setuptools/extern/__init__.py”, line 1, in
ImportError: No module named extern
I Tried this and Im getting a Password field, but I can’t type anything in it. Please help
Just type, it won’t show you anything but will actually be typing behind the scenes. Type your PC’s password and go :)
and using this I get;
iMac:bin greg$ pip install -U pip
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/2.7/bin/pip”, line 7, in
from pip import main
ImportError: cannot import name main
Did you install the way I said above?
i had the same issue — not sure what to do as a python super beginner with little coding experience
I think you should try the way I have written above. ๐ฏ
Hey I am newb at Mac environment. I’m using a hackintosh, and searching for picture n picture (pip Mac) on google I came to this website. Follow the fist part of the tutorial “sudo easy_install pip” and I realised that it isn’t related to picture n picture, xD sorry about that. May I have to uninstall this? How to do this? And do you know some way to enable picture n picture on Mac?
pc58:~ felicite$ sudo easy_install pip
Password:
Searching for pip
Reading http://pypi.python.org/simple/pip/
Couldn’t find index page for ‘pip’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse(‘pip’)
pc58:~ felicite$
JE DOIT FAIRE QUOI MTN,
Searching for pip
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) — Some packages may not be found!
Couldn’t find index page for ‘pip’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) — Some packages may not be found!
I’m getting this as well. =(
I am also getting this
AMAZING! I feel instantly smarter. Thank you!!
Haha! Noice. ๐
Thank you, Ahmad.
I have gone through some number of sources only to find this one straight to the point – once again, thanks.
Glad you liked it! ๐ฏ
Which is the app used in GIF though?
I’m asking about the Terminal app which is used in GIF.
I use iTerm2 and Hyper.js
Read everything I use at this page โ https://AhmadAwais.com/uses
works! thanks!
Hi, thanks for sharing the tutorial. But i get error like this:
โ ~ python –version
Python 2.7.10
โ ~ sudo easy_install pip
Searching for pip
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) — Some packages may not be found!
Couldn’t find index page for ‘pip’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) — Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse(‘pip’)
any suggestions? thanks?
I’m not sure, it feels like a network issue. Maybe you should update your python via brew.
Did you ever figure out how to get around this issue? Same issue here.
Same experience here as zain. (And same python version).
came here organically. SEO on point ๐๐ฝ
I just wrote a simple post. Folks found it useful and so did Google. ๐
Works. Thank you.
Yay!
Thank you….It is worked :)
Yay!!! ๐
Thanks!
this really works. Thank you – i have been trying to figure it out for hours
Hey.. I get this..
$ python –version
Python 2.7.10
$ sudo easy_install pip
Password:
Searching for pip
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) — Some packages may not be found!
Couldn’t find index page for ‘pip’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) — Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse(‘pip’)
Does anyone have any suggestions?
Maybe you can go the route of installing it with `brew` then. Homebrew is something of a package manager for OS X. Find more details on the Homebrew page. Once Homebrew is installed, run the following to install the latest Python, Pip & Setuptools:
brew install python
Also this command was not work
I am getting following error.
Searching for pip
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: [Errno 60] Operation timed out — Some packages may not be found!
Couldn’t find index page for ‘pip’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno 60] Operation timed out — Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse(‘pip’)
Maybe you can go the route of installing it with `brew` then. Homebrew is something of a package manager for OS X. Find more details on the Homebrew page. Once Homebrew is installed, run the following to install the latest Python, Pip & Setuptools:
brew install python
Shivanis-MacBook-Air:usr shivanipriya$ sudo easy_install pip
Searching for pip
Best match: pip 18.1
pip 18.1 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
error: [Errno 2] No such file or directory: ‘/usr/local/bin/pip’
This error is coming when i try to install it. The version is being shown as 2.7 but this command isn’t working.
Maybe you can go the route of installing it with `brew` then. Homebrew is something of a package manager for OS X. Find more details on the Homebrew page. Once Homebrew is installed, run the following to install the latest Python, Pip & Setuptools:
brew install python
Awesome!!!! Crisp, To the Point!!! Bulls Eye!!!
Glad it helped :)
Once I do the command:
sudo easy_install pip
It gives the a prompt saying Password: (with a lock next to it)
What’s this for? Is this an admin thing?
Enter the pass of your computer the one you enter when logging into your laptop. It won’t show anything as you type โ just type and press enter.
After seeing your tutorial if I tipe in: pip install numpy -it still doesn’t work :/
easy install…. great
Hi thanks for the tip. I’m curious what shell you are using to get the colorized commands (as you type), as well as the cool promptline.
Thanks!
Ahmad,
Thanks for this tutorial. Unfortunately my knowledge of coding seems to far surpass my knowledge of how PCs work. Even after installing homebrew, sudo easy_install pip does not work. Still getting the same “Index page” issue as other users. I also tried copying the pip zip from https://pypi.org/simple/pip/into my python application folder but that also does not work. This seems to be a common issue with no clear solution, any suggestions would be extremely welcome.
Thanks,
Brian
Hi,
In my mac, I Installed python 3.7.2.
But when I installed PIP, it has been installed over python 2.7.
HOw can I install pip over 3.7.2?
Thanks for your help
I’d say use
brew
Hi Ahmad,
What is the simplest method to fix this error (Yes, I’ve browsed the web to find many different options, although convoluted and since your practice simplicity, i’d figured i’d ask, Thanks)?
$ sudo easy_install pip
Searching for pip
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) — Some packages may not be found!
Couldn’t find index page for ‘pip’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) — Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse(‘pip’)
$
Just had to add that in order to install on the mac. I had to add –user at the end. I believe that system dependent.
The error I got was
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: ‘/Library/Python/2.7/site-packages/pip-19.0.3-py2.7.egg/EGG-INFO/PKG-INFO’
Consider using the `–user` option or check the permissions.
What I did to fix this “Permission denied” error:
I opened /Library/ (NOT the home user Library folder; not the root/System/Library folder; the root (/) Library folder) and selected the Python folder, did command-i to bring up the “Python Info” window. Saw that only system had Read/Write permissions – “wheel” had Read only, “everyone” had Read only. So I unlocked the lower right lock icon (gave password), added my home admin account using the plus button on the left, then used the cog icon to the right of the plus/minus buttons and chose “Apply to enclosed itemsโฆ”. Then I ran the terminal command again and it successfully installed.
I searched a lot on the web and this is the only solution that worked for me, well done!
Glad to help :)
I’m getting error about permmison
Thanks a lot. Was at a dead end until I saw this.
You are awesome !
Glad to help :)
Hi Ahmad,
I first should thank you for sharing your knowledge, it is really something profound!
I downloaded pip using `python get-pip.py` but I got the following message:
“`ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: ‘/Library/Python/2.7/site-packages/urllib3-1.25.3.dist-info’
Consider using the `–user` option or check the permissions.“`
How can I fix this issue? And how to use `–user`
Note: I tried the old method: `sudo easy_install pip` It worked but when I run `pip install requests` for some program, I get the above ERORR!
Can you help me solve this error please?
Thanks very much!
Try the new method but use install it with `sudo` so your user would have the permissions. That’s what I can guess.
Hi,
Thanks Ahmad and thanks @Muhammed, I solved my issue by running
`pip install requests –user` So, the only thing I had to do is to add `–user` to the end of the command.
Cheers guys :)
Hi,
When I type the password, it showed like this.
‘Processing pip
error: Not a recognized archive type: pip’
How can I solve this issue?
Thanks a lot
Hi, when I Try to run:
python3 get-pip.py
Iยดm getting this error:
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’pypi.org’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)) – skipping
ERROR: Could not find a version that satisfies the requirement pip (from versions: none)
ERROR: No matching distribution found for pip
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’pypi.org’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)) – skipping
This was so helpful!!!
Thank you! ๐
Thank you so much, Ahmad!
Yay!!! ๐
Thank you so much, I have been banging my head for 2 days because i accidentally deleted a few packages and I was not able to install pip, virtualenv because I did not have pkg_resouces. And my system was asking me for pip (Which I did not have) to install this package and I was in a deadlock. However the method provided by you has saved me.
I love your Terminal theme! Which is it please?!
I have built a complete suite of themes called ๐ฆ Shades of Purple โ you can find all about it on my uses page.
Great. Thanks !
I tried to run curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py but below is shown.
File “”, line 1
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
^
SyntaxError: invalid syntax
May I know how to solve it? Thanks
Btw `easy_install` is deprecated, this blog needs updating…
I have already updated the article 10 months ago. Please read it till the end.
Awesome! Thank you so much!
Ahmad, thank you very much, I appreciate you sharing your knowledge.
I successfully used sudo easy_install for a different package (PyPDF2) when pip was not working properly for some reason. Thanks very much!!
Could you please kindly share your shell font in the second gif, thanks a lot!
Everything you see there is my own ๐ฆ Shades of Purple theme. Details are listed on the page that lists software/hardware I use.
What’s the theme of the terminal?
It’s my theme called Shades of Purple. You can also read the details of what software I use at my USES page.
Bro get-pip is not working in my Mac osx
It’s says commond not found.
What tool(s) do you use to generate the GIF recordings of your terminal sessions?
You can check out my uses page to see all the tools I use.
Hello, this was very useful, thank you, however, after entering; ‘sudo easy_install pip’
my terminal responds with; ‘error: Not a recognized archive type: pip’
Any reason for this?
Thanks for your response.
Check the full post for the solution #2.
Oh man! 3 days researching and finally got here, the solution! thanks a lot, I really appreciate this post.
Woohoo! ๐ฅณ๐ฅณ๐ฅณ
hey i am watching a video and it want me to use this command import pyautogui, sleep but it is not working any suggestions?
so happy right now, after going through all those pages finally it worked thanks to you, really appreciate this.
Hah. Happy to help :)
Awesome, thank you
Thank you
Something strange happened only Mac. I installed the pip on the “curl” way successfully, when I run ‘pip list’ it says ” DEPRECATION: Python 2.7 reached the end of its…” (too old). The “python –version” says
Python 3.8.7 . Somehow the pip the old version of Python use. The active is the new one (3.8.7) the is Start the IDLE, or command prompt. The worst in this the installed packages not show in Python eg: pygame, however the pip say it is installed.
Do you have idea, how can I solve it?
I was happy to find this, but only part of it worked. Luckily, I was able to figure out the other part. See here:
**From the Terminal***
Step 1 –
Type: python3 –version – Hit return on the keyboard. You’ll need this information for Step 3.
Step 2 –
Type: curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py – Hit return on the keyboard.
Find get.pip.py. I just did a search in Finder. However, if you pay attention where you ran Step 2 command you’ll be fine.
Step 3 –
Type: python3.9 get-pip.py or your specific version of python. (e.g. python3.8….) – Hit return on the keyboard.
Step 4 –
Type: pip –version – Hit return on the keyboard.
You should get something like this (e.g. pip 21.1.1 from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)
I hope this helps. =)
I get an error message (apparently, the https is not accepted by curl):
>>> curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
File “”, line 1
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
^
SyntaxError: invalid syntax