0

Possible Duplicate:
Installing Python-2.7 on Ubuntu 10.4

I am using CentOS, which bundled with python 2.4. But python 2.4 didn't come with a lot of new features so I downloaded source of 2.7.

After ./configure, make, make install, when I try to install setuptools or easy_install, it shows "zipimport.ZipImportError: can't decompress data; zlib not available".

I checked my zlib installions:

zlib.i386                                1.2.3-3                       installed
zlib-devel.i386                          1.2.3-4.el5                   installed

And yes, I aslo edited the Modules/Setup file under python source, uncomment the zlib line to make sure zlib includes.

But none of them works. The zlib in python still missing. Please help me.

Community
  • 1
  • 1
jay
  • 1,032
  • 2
  • 13
  • 20
  • 1
    You might want to check out this answer: http://stackoverflow.com/questions/6946413/interesting-problem-with-python-2-7-on-centos-is-this-an-issue-with-my-build – joel goldstick Nov 28 '11 at 21:07
  • I am compiling with shared enabled, and there is only 1 python2.7 in the system. The default python is 2.7. So the post didn't help, thank you anyway. – jay Nov 29 '11 at 02:48

1 Answers1

2

Somehow I found a workaround.

I noticed the output of make/make install, it did output the zlibmodule.o in the ./Modules directory, but for some reason it did not link the zlibmodule.o into a zlibmodule.so and copy it into lib directory.

So I run gcc for myself, get the zlibmodule.so and copied it into /usr/local/lib/python2.7/lib-dynload/, everything works fine now.

But still, this is a workaround. I will be glad if anyone could point out the real reason.

jay
  • 1,032
  • 2
  • 13
  • 20