Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zlib not available in OS X?

Tags:

python

macos

zlib

I am trying to install a python library and receive this error after downloading an egg file.

Downloading http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c7-py2.5.egg
Traceback (most recent call last):
  File "setup.py", line 10, in <module>
    use_setuptools(min_version=min_version)
  File "/Users/tylo/Downloads/Archives/simplejson-2.0.9/ez_setup.py", line 88, in use_setuptools
    import setuptools; setuptools.bootstrap_install_from = egg
zipimport.ZipImportError: can't decompress data; zlib not available

I did some research and discovered that zlib is built into OS X.

What could be going wrong here?

like image 438
Tylo Avatar asked May 06 '10 21:05

Tylo


2 Answers

Run xcode-select --install to fix installation of Command Line Tools for Xcode working.

like image 90
penuel Avatar answered Nov 11 '22 21:11

penuel


It's not the zlib C library that is missing, but the zlib Python module. This is usually caused by compiling Python yourself, and not having the necessary bits (header files, specifically) of zlib available, even when you do have the C library available. Or, sometimes, by the zlib Python module having the wrong permissions; take a look in the directories in sys.path, looking for a zlib.so or zlibmodule.so. If it doesn't exist, the Python installation was built without it, or building it failed. If it does exist, check its permissions (and the directory's permissions.)

like image 31
Thomas Wouters Avatar answered Nov 11 '22 21:11

Thomas Wouters