一、zipimport.ZipImportError: can't decompress data; zlib not available
解决方法:
$ tar -xzvf ./Python-3.6.1.tgz
$ cd ./Python-3.6.1
$ ./configure
$ make
$ sudo make install
File"/home/lanhaixuan/Python-3.6.1/Lib/runpy.py", line 193, in_run_module_as_main
"__main__",mod_spec)
File"/home/lanhaixuan/Python-3.6.1/Lib/runpy.py", line 85, in_run_code
exec(code,run_globals)
File"/home/lanhaixuan/Python-3.6.1/Lib/ensurepip/__main__.py",line 4, in
ensurepip._main()
File"/home/lanhaixuan/Python-3.6.1/Lib/ensurepip/__init__.py",line 189, in _main
default_pip=args.default_pip,
File"/home/lanhaixuan/Python-3.6.1/Lib/ensurepip/__init__.py",line 102, in bootstrap
_run_pip(args +[p[0] for p in _PROJECTS], additional_paths)
File"/home/lanhaixuan/Python-3.6.1/Lib/ensurepip/__init__.py",line 27, in _run_pip
import pip
zipimport.ZipImportError:can't decompress data; zlib not available
Makefile:1064:recipe for target 'install' failed
make: *** [install]Error
1.重点修改:Modules/setup.dist文件
#zlibzlibmodule.c -I(prefix)/include?L(exec_prefix)/lib -lz 注释取消
#eadlinereadline.c -lreadline -ltermcap注释取消解决乱码问题
2.安装zlib
$ tar -xzvf ./zlib-1.2.11.tar.gz$ cd ./zlib-1.2.11
$ ./configure$ make
$ sudo make install
然后再次回到python主目录
#make
#make install