Friday, October 26, 2012

Installing Python 2.4 with-zlib on Debian squeeze


Yap, it’s not as easy as it is supposed to be.
1. First of all make sure you have installed zlib-dev library, which in Debian/Ubuntu is called zlib1-dev:
$ sudo aptitude install zlib1-dev
  1. Download Python from http://www.python.org/download/releases/2.4.6/
$ cd /tmp
$ wget http://www.python.org/ftp/python/2.4.6/Python-2.4.6.tgz
  1. Decompress it:
$ tar -zxvf Python-2.4.6.tgz
4. Compile it. STOP, I did that 10 times already with and without –with-zlib=/usr/include option, nothing, only a lot of frustration. So here is the key:
$ cd /lib
$ sudo ln -s x86_64-linux-gnu/libz.so.1 libz.so
  1. Now compile and install python:
$ cd /tmp/Python-2.4.6
$ ./configure --prefix=/opt/python24
$ make
$ make install
  1. Test if zlib is installed:
$ /opt/python24/bin/python -c "import zlib"
  1. Enjoy :o)

No comments: