Zlib 在 OS X 中不可用?
我正在尝试安装 python 库,但在下载 Egg 文件后收到此错误。
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
我做了一些研究,发现 zlib 内置于 OS X 中。
这里可能出了什么问题?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
运行 xcode-select --install 来修复 Xcode 命令行工具的安装。
Run
xcode-select --install
to fix installation of Command Line Tools for Xcode working.缺少的不是 zlib C 库,而是 zlib Python 模块。这通常是由于您自己编译 Python,并且没有可用的 zlib 必要位(特别是头文件)造成的,即使您确实有可用的 C 库也是如此。或者,有时,zlib Python 模块具有错误的权限;查看
sys.path
中的目录,查找zlib.so
或zlibmodule.so
。如果它不存在,则 Python 安装是在没有它的情况下构建的,或者构建失败。如果确实存在,请检查其权限(以及目录的权限。)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 azlib.so
orzlibmodule.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.)