mac os 에서 pyenv 로 python 설치 시에 에러 발생



Installing Python-3.6.3...


BUILD FAILED (OS X 10.13.4 using python-build 20160602)


Inspect or clean up the working tree at /var/folders/s_/k8bzmkfn6pjbmd9htyh0t9lh0000gn/T/python-build.20180521195607.52627

Results logged to /var/folders/s_/k8bzmkfn6pjbmd9htyh0t9lh0000gn/T/python-build.20180521195607.52627.log


Last 10 log lines:

  File "/private/var/folders/s_/k8bzmkfn6pjbmd9htyh0t9lh0000gn/T/python-build.20180521195607.52627/Python-3.6.3/Lib/ensurepip/__main__.py", line 4, in <module>

    ensurepip._main()

  File "/private/var/folders/s_/k8bzmkfn6pjbmd9htyh0t9lh0000gn/T/python-build.20180521195607.52627/Python-3.6.3/Lib/ensurepip/__init__.py", line 189, in _main

    default_pip=args.default_pip,

  File "/private/var/folders/s_/k8bzmkfn6pjbmd9htyh0t9lh0000gn/T/python-build.20180521195607.52627/Python-3.6.3/Lib/ensurepip/__init__.py", line 102, in bootstrap

    _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)

  File "/private/var/folders/s_/k8bzmkfn6pjbmd9htyh0t9lh0000gn/T/python-build.20180521195607.52627/Python-3.6.3/Lib/ensurepip/__init__.py", line 27, in _run_pip

    import pip

zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1

pyenv를 이용하여 python 을 설치할 때 위와 같은 에러가 일어나면???


아래의 명령어를 입력하여 해결해 준다. 

CFLAGS="-I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include" \

LDFLAGS="-L$(brew --prefix openssl)/lib" \
pyenv install -v 3.5.0