1.安裝Homebrewpython
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.安裝pyenvgit
brew update
brew install pyenv
3.在 .bash_profile 文件中添加 github
export PYENV_ROOT=/usr/local/var/pyenv if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
4.在終端中更新輸入ruby
source .bash_profile
5.安裝3.X版本pythonbash
pyenv install 3.5.1
6.安裝完成後進行更新curl
pyenv rehash
7.查看已安裝版本url
pyenv versions
8.切換python版本spa
pyenv global 3.5.1
9.確認python版本code
python