Sunday, May 2, 2010

Plone 3 on Ubuntu Lucid Lynx: Hand-compiling Python 2.4

update 2010-05-31: Warning for /usr/local/bin/python

After the upgrade to Ubuntu 10.04 (Lucid Lynx), i had no python2.4 binary anymore (causing a bash: ./bin/instance: /usr/bin/python2.4: bad interpreter: No such file or directory error), so i had to compile it myself. Hand-compiling is a big word here, because it was very, very easy:
tar -xzf Python-2.4.6.tgz
cd Python-2.4.6/
sudo make install

A typical case of CMMI (configure, make, make install)! Note: You may want to consider installing Python 2.4 in /opt, see the warning below.

(After this, you'll have to install PIL again, using easy_install which you'll have to install as well, see the post at

Note that python2.4 now lives in /usr/local/bin/ instead of /usr/bin/, so you'll also have to run bootstrap and buildout again on existing buildouts.

Warning: This will also add a symlink called python to your /usr/local/bin/, which may take precedence over your system python (2.6). This is a problem for Ubuntu's, which uses #!/bin/env python. This will result in a an import error:
$ system-config-printer
Traceback (most recent call last):
File "/usr/share/system-config-printer/", line 30, in
from timedops import *
File "/usr/share/system-config-printer/", line 20, in
import gobject
ImportError: No module named gobject

I think it's best to change the header line of that script to /usr/bin/python as recommended in the Launchpad issue, and additionally remove the python symlink in /usr/local/bin/. Maybe it's better to install Python 2.4 in /opt to avoid this kind of conflict.

No comments: