You need to test something under fedora, so you don't want to use the python that comes with your system, you need to compile one yourself. After compiling, need to install PIP,PIP need setuptools, and setuptools need zlib library, in executing
./configure--help
./configure--prefix=~/.local/python2. 7 --with-zlib
It's very strange not to see the--with-zlib option, but this option is still used, and the fact is, even with this option, the new version of Python still does not have a zlib library.
1. In fact, the answer is very simple, need to install zlib-devel, as long as the system Lee installed this package, do not need to specify,--with-zllib=/usr/include,python will automatically install the Zlib module.
SU-DNF install-y Zlib-devel
2. But what if we download a zlib package ourselves, for example: Zlib-1.2.8.tar.gz? Let's compile a look.
/configure--prefix=/home/nhuang/.local/python2. 7/--with-zlib=. /zlib-1.2. 8 Make Make Install
Execute import zlib, success, but I do not recommend the use of the second method!
--Nhuang2
Python: How do I zlib a library when compiling python?