5

I already have Python2.7 but due to certain reasons I need to install Python2.4. So, I installed python2.4 and when I run ez_setup.py with Python2.4/python ez_setup.py, I got the error that says

can't decompress data; zlib not available.

I installed zlib1g and zlib1g-dev as well. I restarted my console but I am still getting this error. Can anyone help me with this? I got ez_setup.py from this link.

When I do

which zlib

in the console it says

zlib not found

1
  • A little more context on the error might be helpful... Was there more to it? Aug 9, 2012 at 16:35

1 Answer 1

7

I don't find a Python 2.4 package for Ubuntu, so I assume you tried to compile it from source. If so, you would have had to explicitly configure and compile it with zlib support.

I found a blog article on how to do this here:

http://www.1stbyte.com/2005/06/26/configure-and-compile-python-with-zlib/

basically install zlib1g-dev, and then configure Python with

./configure --with-zlib=/usr/include

then you can do "make" to generate the Python 2.4 binaries.

3
  • 1
    configure: WARNING: unrecognized options: --with-zlib (Python 2.7.3) ??
    – szx
    Sep 7, 2012 at 12:13
  • run ./configure --help to see the available options for the software you're trying to build. BTW, if it's Python 2.7, that's widely available as a package for Ubuntu so you shouldn't need to build from source.
    – roadmr
    Sep 7, 2012 at 14:28
  • from what directory do you run ./configure --with-zlib=/usr/include
    – Sam
    Feb 26, 2021 at 7:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.