编译 Zlib support into your Python interpreter的方法:
1. 安装Zlib-dev包 for your distribution. (你可能已经装了zlib,但没有 dev package)
在Ubuntu上叫zlib1g-dev,在其他linux上可能叫: zlib-dev 或 zlib-devel. 搜索系统的发行版的软件包列表来找到它,You should end up with a ‘zlib.h’ file in your system。
在我的Ubuntu系统上,它在 /usr/include/zlib.h
2. 使用你的python源码来编译,运行如下的脚本命令:
./configure –with-zlib=/usr/include
这里可以看到我用‘/usr/include’目录来查找zlib.h在哪里。在 make && make install 之后,它就起作用了。
本文介绍如何将Zlib库支持编译进Python解释器。首先需安装Zlib-dev包,例如在Ubuntu中安装zlib1g-dev。然后通过指定包含路径配置Python源码进行编译,最终实现Zlib的支持。
1169

被折叠的 条评论
为什么被折叠?



