该模块现在有其他名称吗?我似乎找不到任何信息表明该模块已被弃用或完全删除。 (这会让我更加困惑)
有谁知道这去哪儿了?
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
更新:我在使用 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]
[解决了]http://www.1stbyte.com/2005/06/26/configure-and-compile-python-with-zlib/ http://www.1stbyte.com/2005/06/26/configure-and-compile-python-with-zlib/