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
更新:我在使用 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/配置和编译-python-with-zlib/
is this module named something else now? I can't seem to find any info saying that this module was deprecated or dropped completely. (which would confuse me further)
Anyone know where this went?
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: I found this in the source bundle i used Python-3.1.2/Modules/zlib/ChangeLog
The last change was in 2005 and it doesn't mention anything telling.
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/26/configure-and-compile-python-with-zlib/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(通过在问题中编辑 URL 来回答。转换为社区 wiki 答案。请参阅 没有答案的问题,但问题在评论中得到解决(或在聊天中扩展))
OP 写道:
SO 不赞成仅使用 URL 答案,并且从 GregTheGeek 转录博客是不合适的在那个网站上。然而,总而言之,必要的步骤是:
Zlib-dev
软件包。例如,在 Ubuntu 上,它称为zlib1g-dev
。这将提供zlib.h
包含文件。./configure –with-zlib=/usr/include
make
和make install
应该可以工作。(Answered by editing a URL into the question. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
SO deprecates URL only answers, and it would be inappropriate to transcribe the blog from GregTheGeek on that site. However, in summary, the steps necessary are:
Zlib-dev
package. For example on Ubuntu it is calledzlib1g-dev
. This will provide thezlib.h
include file../configure –with-zlib=/usr/include
make
andmake install
should work.