Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble using pip after installing Python 2.7 with Homebrew on Mac OS X 10.6.8

I just used homebrew to install Python 2.7.2 on a clean Mac OS X Snow Leopard install, but seem to be having trouble getting PIP to work with it well.

Here are the steps that I took:

  1. Installed python with Homebrew: brew install python --framework --universal
  2. Updated my paths in my .zsrc
  3. Made a symbolic link from /System/Library/Frameworks/Python.framework/Versions/Current to /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/Current
  4. Used easy_install to install pip

These steps seem like they have worked:

$ brew doctor
Your system is raring to brew.

$ which python
/usr/local/bin/python

$ python --version
Python 2.7.2 

$ which easy_install
/usr/local/share/python/easy_install

$ which pip
/usr/local/bin/pip

However, when I try to install things with pip, for example $ pip install ipython I get this error message '/System/Library/Frameworks/Python.framework/Versions/2.6/share': Permission denied

Why is pip still trying to install an old Python 2.6 location? How do I get it to install things to /usr/local/Cellar/python/2.7.2/ etc?

like image 776
Joshmaker Avatar asked Feb 25 '12 18:02

Joshmaker


2 Answers

So, it looks like the way that I installed things I needed to use /usr/local/share/python/pip-2.7 instead of /usr/local/share/python/pip.

Not sure why I have both pip and pip-2.7 but Aliasing my pip to the the 2-7 version seems to fix my issue.

like image 111
Joshmaker Avatar answered Sep 26 '22 13:09

Joshmaker


Homebrewed Python now installs pip.

Since a while pip is installed directly into your homebrew-bin directory.

Therefore, $(brew --prefix)/bin/pip should be in your PATH, if your Homebrewbrew is set up correctly.

like image 34
Samuel John Avatar answered Sep 25 '22 13:09

Samuel John