When I finished my last blog, I realized I left out a key group of developers on Mac OS X. I didn’t want to leave out my Homebrew fans, so this blog is dedicated to the brew users out there in the world. For those who don’t know, Homebrew is an alternative package manager to MacPorts on the Mac OS X platform. I am a MacPorts person myself, but I always believe that you should challenge yourself by learning different tools.
Since this is a follow-up blog, it will be short and sweet. The blog entitled “This is the Green Room” has a great entry on setting up Homebrew on Mac OS X Lion. We will reference this blog, with some minor tweaks of course..:-).
As in my last blog, there are prerequisites. The following is needed:
After the prereqs are met, its time to get to brewing…
As referenced in here, install Homebrew.
Next we will install Python. This can also be referenced in the blog as well. Run the following commands:
brew install readline sqlite gdbm pkg-config
brew install python --framework --universal
To make sure that the newly installed python is used, create or edit the .bash_profile file by adding the following line:
Once that is done, source the .bash_profile file:
Next, we need to change Lion’s symlink to point to the new Python installation. Run the following commands:
sudo rm -rf Current
sudo ln -s /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/Current
Next we install Pip. This also is referenced in the blog. To install Pip, run the following command:
After Pip is done installing, its time to install virtualenv:
pip install virtualenv
From here on out, you just need to reference my previous blog, starting from the section “Setting Up Your Virtual Env and Installing the Required Modules”.