一、安装Homebrewjavascript
将命令行复制至终端,进行安装。java
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
二、安装pyenvpython
brew update
brew install pyenv
2.1在 .bash_profile 文件中添加
git
export PYENV_ROOT=/usr/local/var/pyenv if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
2.2在终端中更新输入:github
source .bash_profile
三、安装3.X版本pythonruby
pyenv install 3.5.1
四、安装完成后进行更新bash
pyenv rehash
五、查看已安装版本curl
//号表示系统当前正在使用的版本 pyenv versions
六、切换python版本url
pyenv global 3.5.1
七、确认python版本spa
python