发布时间:2019-09-18 07:27:52编辑:auto阅读(2802)
先去http://www.zlib.net/下载最新版本的zlib源码文件
安装zlib:
[]#tar xzvf zlib-1.2.8.tar.gz
[]#cd zlib-1.2.8
[]#./configure
[]#make
[]#make install
zlib安装完后,libz.a在/usr/local/lib/,zlib.h文件在/usr/include (opensuse中zlib.h默认放在/usr/local/include/中)
进入Python源码文件目录,重新编译Python
[]#./configure –prefix=/home/program/python3 –with-zlib=/usr/include
[]#./configure –prefix=/home/program/python3 –with-zlib-dir=/usr/local/lib
都可以完成python对zlib库的支持,在python源码中直接import zlib即可使用zlib了。
上一篇: Python 向word(docx)中输
下一篇: 被弃用的Python2中的方法和Pyth
47840
46386
37279
34731
29312
25970
24909
19949
19541
18026
5790°
6411°
5926°
5960°
7063°
5910°
5942°
6437°
6404°
7776°