之前用的很多都是Python3.6版本,所以不知道3.7版本在编译安装时居然有一个小坑,这里简单记录一下,以作备忘!
Traceback (most recent call last): File "/opt/Python-3.7.0/Lib/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/opt/Python-3.7.0/Lib/runpy.py", line 85, in _run_code exec(code, run_globals) File "/opt/Python-3.7.0/Lib/ensurepip/__main__.py", line 5, in <module> sys.exit(ensurepip._main()) File "/opt/Python-3.7.0/Lib/ensurepip/__init__.py", line 204, in _main default_pip=args.default_pip, File "/opt/Python-3.7.0/Lib/ensurepip/__init__.py", line 117, in _bootstrap return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) File "/opt/Python-3.7.0/Lib/ensurepip/__init__.py", line 27, in _run_pip import pip._internal zipimport.ZipImportError: can't decompress data; zlib not available make: *** [install] 错误 1
报错截图:
一般位于3.7以上版本编译安装时出错提示缺少依赖包libffi-devel,是由于在安装3.7以上版本时,需要一个新的libffi-devel包做依赖。
yum install libffi-devel -y
重新make &&make install