去http://www.zlib.net/下载最新版本的zlib源码文件
安装zlib:
tar xzvf zlib-1.2.13.tar.gz
cd zlib-1.2.13
./configure
make && make install
zlib安装完后,libz.a在/usr/local/lib/,zlib.h文件在/usr/local/include (opensuse中zlib.h默认放在/usr/local/include/中)
重新编译python
进入Python源码文件目录,重新编译Python
./configure –prefix=/url/local/python3 –with-zlib=/usr/local/include
./configure –prefix=/url/local/python3 –with-zlib-dir=/usr/local/lib
都可以完成python对zlib库的支持,在python源码中直接import zlib即可使用zlib了。
make && make install
标签:Python,make,zlib,源码,usr,模块,local From: https://www.cnblogs.com/liuxuqiang/p/17159616.html