Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I spent most of the day yesterday searching for a clear answer for installing pip. I can't find a good solution.

Can somebody help me install it?

share|improve this question
4  
The System is not responding... –  jpihl May 29 at 9:46
3  
I'm guessing 400 upvotes means "correct" at this point. –  bmoeskau Aug 12 at 8:24

7 Answers 7

All you need to do is

sudo easy_install pip
share|improve this answer
33  
And it's turtles, all the way down –  nmr Jan 31 at 0:16
6  
This is so fetch! –  Catfish Apr 1 at 4:23
10  
Stop trying to make fetch happen! Also, thanks for the answer. –  Ted Kulp May 19 at 0:41
1  
If you are behind a proxy, make sure http_proxy and https_proxy are set correctly, then use the '-E' option with sudo: sudo -E easy_install pip –  Neil Schaper Aug 4 at 20:10
1  
Something is very wrong when this answer is not only not accepted, but also listed LAST on the page at the time of this writing. Hmmm. –  bmoeskau Aug 12 at 8:25

You can install it through Homebrew on OS X.

Homebrew is something of a package manager for OS X, more details here: http://mxcl.github.io/homebrew/

If you have Homebrew installed, pip installs with python:

brew install python

Note that this will also install an updated python, default is currently 2.7.5 while brew's python is 2.7.6.

share|improve this answer
    
Pip isn't running even after following your steps? I restarted the shell but still no avail. –  lovedynasty Sep 17 '13 at 13:51
1  
Have you made sure that you've got /usr/local/bin in your PATH? Try running /usr/local/bin/pip which is a full path to the pip program. –  Leigh Sep 18 '13 at 6:44
1  
The folder /usr/local/bin/pip was in path but pip wasn't running. I deleted the folder and reinstalled it and now it runs. Thanks !! –  lovedynasty Sep 19 '13 at 8:58
11  
You can also just sudo easy_install pip if all you want is pip on stock Python. –  Jamie Schembri Sep 21 '13 at 11:27
1  
Note that if you use homebrew, then you end up using your own python, not the system one. This is the road to hell if you want to use wxpython ... –  GreenAsJade Nov 10 '13 at 3:09

The simplest solution is to follow the installation instruction from pip's home site.

Basically, this consists in:

  • downloading get-pip.py. Be sure to do this by following a trusted link since you will have to run the script as root.
  • call sudo python get-pip.py

The main advantage of that solution is that it install pip for the python version that has been used to run get-pip.py, which means that if you use the default OS X installation of python to run get-pip.py you will install pip for the python install from the system.

Most solutions that use a package manager (homebrew or macport) on OS X create a redundant installation of python in the environment of the package manager which can create inconsistencies in your system since, depending on what you are doing, you may call one installation of python instead of another.

share|improve this answer
    
I have a second brew installed python, but I am trying to install pip on my original /usr/bin mac python. Do you know how I can access pip for that installation? I used /usr/bin/python to install pip, but pip wasn't in /usr/bin/. –  Wesley Jun 26 at 16:28

To install or upgrade pip, download get-pip.py from http://www.pip-installer.org/en/latest/installing.html

Then run the following: sudo python get-pip.py

For example:

sudo python Desktop/get-pip.py 
Password:
  Downloading/unpacking pip
  Downloading pip-1.5.2-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
Successfully installed pip
Cleaning up...

sudo pip install pymongo
Password:
Downloading/unpacking pymongo
  Downloading pymongo-2.6.3.tar.gz (324kB): 324kB downloaded
  Running setup.py (path:/private/var/folders/0c/jb79t3bx7cz6h7p71ydhwb_m0000gn/T/pip_build_goker/pymongo/setup.py) egg_info for package pymongo

Installing collected packages: pymongo
...
share|improve this answer
1  
Yes, but there are simpler methods –  ultimatetechie Apr 10 at 6:24
$ sudo port install py27-pip

Then update your PATH to include py27-pip bin directory (you can add this in ~/.bash_profile PATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH

pip will be available in new terminal window.

share|improve this answer

You should install Brew first:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then brew install Python

brew install python

Then pip will work

share|improve this answer
    
But - you have not installed pip in the system python in this case, rather you have installed a new python and pip along with it. Then you will be into all sorts of strife trying to use wxpython... –  GreenAsJade Nov 10 '13 at 3:10
3  
I think the link should now be raw.github.com/mxcl/homebrew/go/install –  Steve Bennett Nov 26 '13 at 2:49
    
The command should now be: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" –  pdxbmw Oct 12 at 17:40

Download this file: get-pip.py

Then simply type

sudo python get-pip.py

Make sure you are on the same directory as get-pip.py or you supply the correct path for that file.

For details, you can visit: http://pip.readthedocs.org/en/latest/installing.html

or, http://thegauraw.tumblr.com/post/47601704154/how-to-install-pip-in-both-windows-ubuntu-easiest-way

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.