Installing Python2.6 with homebrew | Alex Kessinger

First day at my new gig, and I was confronted with a quandary. I like homebrew, but picplz is running python 2.6. There was no clear method for installing the python 2.6 using homebrew. Internally they are using MacPorts. If I couldn’t figure it out in a timely manner, I was just going to roll with macports, but I figured it out.

My solution speaks to the flexibility of homebrew. There might even be a git optimized way of doing this, but I just hacked my way around it.

Essentially, they switched form python 2.6 to 2.7 with no clear way to install python2.6. I just looked in the history to find the python2.6 version, and pulled that down into my formula directory.

cd /usr/local/Library/Formula;

curl "http://github.com/mxcl/homebrew/raw/acd49f721fca4d7ca495e188899dea874ec35a1e/Library/Formula/python.rb" > python2.6.rb;

I called it python2.6.rb, and had to rename the inner formula class python26 as well.

See my gist of the formula

After install homebrew, download this file into your Formula directoy. Mine is at /usr/local/Library/Formula then you can just install this like normal.

brew install python2.6

About

I like to curate stuff. Checkout my blog at http://alexkessinger.net, before using posterous I posted directly to google reader.

DeliciousTumblr