OS X El Capitan(10.11.5) HomeBrew installed
Python2 is included by default, but I want to manage version switching, so install pyenv (rbenv in ruby)
$ brew install pyenv
Path setting
$ export PYENV_ROOT="$HOME/.pyenv"
$ export PATH="$PYENV_ROOT/bin:$PATH"
$ eval "$(pyenv init -)"
Check the version of python that can be installed
$ pyenv install --list
Install the latest python3.5.1
$ pyenv install 3.5.1
error. .. ..
Downloading Python-3.5.1.tgz...
-> https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz
Installing Python-3.5.1...
BUILD FAILED (OS X 10.11.5 using python-build 20160130)
Inspect or clean up the working tree at /var/folders/cc/yzctrdxs00s81p18dssxqhpw0000gn/T/python-build.20160605231006.7256
Results logged to /var/folders/cc/yzctrdxs00s81p18dssxqhpw0000gn/T/python-build.20160605231006.7256.log
Last 10 log lines:
File "/private/var/folders/cc/yzctrdxs00s81p18dssxqhpw0000gn/T/python-build.20160605231006.7256/Python-3.5.1/Lib/ensurepip/__main__.py", line 4, in <module>
ensurepip._main()
File "/private/var/folders/cc/yzctrdxs00s81p18dssxqhpw0000gn/T/python-build.20160605231006.7256/Python-3.5.1/Lib/ensurepip/__init__.py", line 209, in _main
default_pip=args.default_pip,
File "/private/var/folders/cc/yzctrdxs00s81p18dssxqhpw0000gn/T/python-build.20160605231006.7256/Python-3.5.1/Lib/ensurepip/__init__.py", line 116, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/private/var/folders/cc/yzctrdxs00s81p18dssxqhpw0000gn/T/python-build.20160605231006.7256/Python-3.5.1/Lib/ensurepip/__init__.py", line 40, in _run_pip
import pip
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
It seems that XCode command line tools were needed when updating the OS (https://github.com/yyuu/pyenv/wiki problems # build-failed-error-the-python-zlib-extension-was-not-compiled-missing-the-zlib))
$ xcode-select --install
xcode-select: note: install requested for command line developer tools
Install python3.5.1 again
$ pyenv install 3.5.1
Check version
$ pyenv versions
* system (set by /Users/32mashamasha/.pyenv/version)
3.5.1
I was able to install (´ ▽ `) ノ
Recommended Posts