OS X El Capitan(10.11.5) HomeBrew installé
Python2 est inclus par défaut, mais je souhaite gérer le changement de version, alors installez pyenv (rbenv dans ruby)
$ brew install pyenv
Réglage du chemin
$ export PYENV_ROOT="$HOME/.pyenv"
$ export PATH="$PYENV_ROOT/bin:$PATH"
$ eval "$(pyenv init -)"
Vérifiez la version de python qui peut être installée
$ pyenv install --list
Installez le dernier python3.5.1
$ pyenv install 3.5.1
Erreur. .. ..
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
Il semble que les outils de ligne de commande XCode étaient nécessaires lors de la mise à jour du système d'exploitation (https://github.com/yyuu/pyenv/wiki problèmes # 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
Installez à nouveau python3.5.1
$ pyenv install 3.5.1
Vérifier la version
$ pyenv versions
* system (set by /Users/32mashamasha/.pyenv/version)
3.5.1
J'ai pu installer (´ ▽ `) ノ