Installing Python 2.6/2.7 on Debian Lenny

Just a quick note to Google-eyed installers of Python who can’t get python to start after compiling it from source. Debian 5 ships with Python 2.5.x and complains about libpython after you install 2.6 or 2.7. The solution is very simple and quick:

Create the following 2 symlinks to sort yourselves out:

ln -s /usr/local/lib/ /usr/lib/
ln -s /usr/local/lib/ /usr/

If you’re on a 64 bit OS replace /usr/lib/ with /usr/lib64/

My full setup script for Python including threads etc is:

# as sudo / root:
tar -xvzf Python-2.6.4.tgz
cd Python-2.6.4
./configure –with-threads –enable-shared
make install
# fix libpython2.6 problem
ln -s /usr/local/lib/ /usr/lib64/
ln -s /usr/local/lib/ /usr/

7 Responses to “Installing Python 2.6/2.7 on Debian Lenny”

Leave a Reply