brew install pyenv
brew install homebrew/boneyard/pyenv-pip-rehash
Put the minimum required settings in .zshrc (change according to Shell)
There is an article that sets PYENV_ROOT, but there is no need to change the installation destination of python.
By default, it is installed in ~ / .pyenv / shims
, but if you really want to change it, set it.
vi ~/.zshrc
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
source ~/.zshrc
Check the version that can be installed
pyenv install -l
Install by specifying the version
pyenv install 3.5.1
Change to 3.4.3 with system default python installed
pyenv local x.x.x
is a python version of the current directory only, so use global to change it system-wide.
pyenv global 3.5.1
Reflect the settings
pyenv rehash
Check if it is switched
python --version
Install pip for python package management
easy_install pip
Recommended Posts