Feb 8, 2010

MacOS 10.6, python and PIL

Since I got a python script from avocadohead (kudos and thanks for saving a lot of time) for easily creating a plain html gallery with thumbnails using imagemagick, I needed to get python running. The version included in MacOS 10.6 is known somewhat troublesome when installing the PIL library so I chose the easy way:

Prerequisites: you need to have Xcode and X11 installed from the original OS DVD

Install Macports. Then install python 2.6, imagemagick, PIL by casting the following commands on a terminal:

sudo port install imagemagick
sudo port install python
sudo port install py26-pil

In order to change the python interpreter to the one Macports installed, you need to install

sudo port install python_select

Execute python_select in a terminal for getting the right python running. With this script, you can easily change between the built-in python and the addionally installed one without a hassle.

2 comments:

avocadohead said...

Ran another home-made script on yet another Macbook today following your recipe (yay! thanks) and got into some version muddle. Apparently there are both py26- and py- ports for things like PIL, matplotlib etc., and the python26 we chose from the python_select list worked only with the py26- packages. Oh, and without Apple's developer tools (from the OS DVD) there's no gcc.
PS: Not my Macbook!

DaWuzzzz said...

My pleasure! Hope you'll have your OWN MBP soon