pyenv BUILD FAILED解决方法

在本机mac上安装pyenv安装成功后,用pyenv来安装python 3.5.0又出现了如下的问题:

 -> pyenv install 3.5.0
Downloading Python-3.5.0.tgz...
-> https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz
Installing Python-3.5.0...

BUILD FAILED (OS X 10.10.5 using python-build 20160130)

Inspect or clean up the working tree at /var/folders/jz/_yq255hj5zgbjjh1_jr4s59h0000gn/T/python-build.20170118092407.6886
Results logged to /var/folders/jz/_yq255hj5zgbjjh1_jr4s59h0000gn/T/python-build.20170118092407.6886.log

Last 10 log lines:
  File "/private/var/folders/jz/_yq255hj5zgbjjh1_jr4s59h0000gn/T/python-build.20170118092407.6886/Python-3.5.0/Lib/ensurepip/__main__.py", line 4, in <module>
    ensurepip._main()
  File "/private/var/folders/jz/_yq255hj5zgbjjh1_jr4s59h0000gn/T/python-build.20170118092407.6886/Python-3.5.0/Lib/ensurepip/__init__.py", line 209, in _main
    default_pip=args.default_pip,
  File "/private/var/folders/jz/_yq255hj5zgbjjh1_jr4s59h0000gn/T/python-build.20170118092407.6886/Python-3.5.0/Lib/ensurepip/__init__.py", line 116, in bootstrap
    _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/private/var/folders/jz/_yq255hj5zgbjjh1_jr4s59h0000gn/T/python-build.20170118092407.6886/Python-3.5.0/Lib/ensurepip/__init__.py", line 40, in _run_pip
    import pip
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1

解决方法:使用如下语句安装即可解决问题
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 3.5.0

参考资料

pyenv BUILD FAILED解决方法

posted on 2017-01-18 10:30  mingaixin  阅读(1658)  评论(0编辑  收藏  举报