Jun 28, 2012

Stuck installing Python using Homebrew (Mac OSX Lion)

I tried to install python (once again), but been stuck for a while. So I leave a note for future myself.

First of all,
brew install python
fails due to "permission denied".
This has to do with something replacing files under /System/Library/Frameworks/Python.Framework so I changed owner of the folder, though it is a bit uncomfortable.
sudo chown $USER /System/Library/Frameworks/Python.Framework

After that, I tried installed pip and virtualenv.
easy_install pip
pip install virtualenv

but, pip didn't work complaining "there is no such module named setuptools".
I had been stuck this for a while, but solution is written in a message of "brew install python" (I couldn't see it for the first time)
Before you use pip, you have to do
pip install --upgrade distribute

make sure, easy_install and pip is homebrewed. They are under /usr/local/share/python and you should set $PATH like
export PATH=/usr/local/share/python:$PATH

1 comment:

Liang said...

There is some typo in your post

pip install >>>>--upgrade<<<< distribute

export PATH=/usr/local/>>>>share<<<</python:$PATH

However your post indeed helps me a lot, great thanks!