编译 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 之后,它就起作用了。