• I have a machine running Scientific Linux 6
  • It comes with Python 2.6 by default
  • I've also installed Python 2.7.3 because I need to run some modules which only work with newest versions. This is working nicely.
  • I need to install more libraries for Python 2.7.3
  • I'm trying to install setuptools in order to grab these modules

[root@sa09b tmp]# wget http://peak.telecommunity.com/dist/ez_setup.py

[root@sa09b tmp]# python2.7 ez_setup.py Downloading


Traceback (most recent call last): File "ez_setup.py", line 278, in

main(sys.argv[1:]) File "ez_setup.py", line 212, in main

from setuptools.command.easy_install import main

zipimport.ZipImportError: can't decompress data; zlib not available

oh? I thought I had that installed.

[root@sa09b tmp]# yum install zlib Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

  • sl: ftp1.scientificlinux.org

  • sl-security: ftp1.scientificlinux.org

Setting up Install Process

Package zlib-1.2.3-27.el6.x86_64 already installed and latest version

Nothing to do

  • So I looked up various forums
  • Most tell me to install zlib-devel (done "Package zlib-devel-1.2.3-27.el6.x86_64 already installed and latest version"), zlib1g ("No package zlib1g available."), zlib1g-devel (same as before).

Any ideas?



[root@sa09b tmp]# zlib

-bash: zlib: command not found

could that be it?

Edit 2:

  • So the line which fails is "from setuptools.command.easy_install import main"
  • I think this is because the .egg file with setuptools needs to be extracted with zlib
  • I tried installing pip, but that requires setuptools too.
  • I can't use easy_install-2.7 for some reason. But easy_install for 2.6 works fine.

Edit 3:

"find" can't actually find anything to do with zlib in the system, other than python, despite yum saying its installed.

[root@sa09b pip-1.2.1]# find / -name zlib

I found the answer from another stackoverflow user.

Basically you can just copy zlib pre gcc'd from 2.6 to 2.7:

cp /usr/lib64/python2.6/lib-dynload/zlibmodule.so /usr/local/lib/python2.7/lib-dynload/zlibmodule.so

Still hackish though.

| improve this answer | |
  • Nice. This worked for me. – ftkg Oct 15 '13 at 18:08
  • work like a charm. – BlaShadow Dec 9 '13 at 1:51

I've had a similar problem. In my case the issue was that I had to install zlib-devel along other packages (see here http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/) before building Python-2.7. Once the packages are installed, running ./configure for Python makes all the difference of detected libraries and subsequently make && make altinstall links them.

| improve this answer | |

You example of attempting to execute zlib does NOT indicate presence (or absence) of zlib...only that the zlib command does not exist.

zlib is simply a library of routines.

What you need to look at is what version of zlib needs to be installed and used by all the programs. I suspect either the errant program is looking in the wrong place, or it needs a different version than is installed, or the program needing it is old and needs upgrading.

| improve this answer | |
  • Please can you explain a bit further? I'm really stuck on this. (see second edit). – LittleBobbyTables Jan 3 '13 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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