简体   繁体   中英

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?

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.

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.

Why are you using easy_install to install pip? Based on the path easy_install is probably pointing to Python 2.6, which results to pip point to 2.6 as well.

Doesn't brew install pip fix this?

Otherwise what you are doing looks correct

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM