Python – When installing setuptools on Debian Lenny, why do I get zlib error

debian-lennypythonsetuptools

I'm seeing this error when I run python2.6 setup.py build on Debian Lenny from the setuptools-0.6c11 source:

Compression requires the (missing) zlib module

Best Answer

I think the problem is that python2.6 was not build with zlib. I ran the following commands and this fixed my problem (this assumes you have the Python 2.6 source):

apt-get install zlib1g-dev
cd Python-2.6.5
./configure
make
make install

... there are also lots of other things that python will build with. The installer will not fail if they're missing, it'll just build without them.