0
  • 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

http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg

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?

:-)


Edit:

[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
/tmp/Python-2.7.3/Demo/zlib
/tmp/Python-2.7.3/Modules/zlib

3 Answers 3

3

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.

2
  • Nice. This worked for me.
    – ftkg
    Commented Oct 15, 2013 at 18:08
  • work like a charm.
    – BlaShadow
    Commented Dec 9, 2013 at 1:51
1

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.

0

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.

1
  • Please can you explain a bit further? I'm really stuck on this. (see second edit). Commented Jan 3, 2013 at 19:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .