Python3: 不是 gzip 或者 zlib?

这个模块现在以某种方式调用了吗? 似乎我找不到此模块过时或完全丢弃的任何信息。 /更困惑我/

有谁知道它在哪里?

Python 3.1.2 /r312:79147, May 20 2010, 09:09:30/
[GCC 4.1.2 20080704 /Red Hat 4.1.2-48/] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gzip
Traceback /most recent call last/:
File "", line 1, in
File "/usr/local/lib/python3.1/gzip.py", line 9, in
import zlib
ImportError: No module named zlib
UPDATE: 我在来源中找到了它 bundle 我用了 Python-3.1.2 / Modules/zlib/ChangeLog
最后一次发生变化 2005 一年,它没有提到任何东西。

ChangeLog file for zlib
Changes in 1.2.3 /18 July 2005/
- Apply security vulnerability fixes to contrib/infback9 as well
- Clean up some text files /carriage returns, trailing space/
- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant]
[SOLVED]
http://www.1stbyte.com/2005/06 ... zlib/
/
已邀请:

知食

赞同来自:

/答案是通过编辑给出的 URL 在这个问题。 转变为社区回应 wiki. 看

/ /

OP 发布者:

[SOLVED] http://www.1stbyte.com/2005/06 ... zlib/

SO

谴责只有答案 URL, 通过翻译博客是不合适的 GregTheGeek 在那个网站上。 但是,简单来说,必要的步骤是:

设置相应的包
Zlib-dev

. 例如, Ubuntu 它被称为
zlib1g-dev

. 这将提供文件
zlib.h

include.

编译来源后 python 运行脚本 configure:
./configure –with-zlib=/usr/include


现在他们必须工作
make


make install

.

要回复问题请先登录注册