之前用的很多都是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