参考:https://github.com/yyuu/pyenv-installer
$ curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash $ vim .bash_profile export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" $ source .bash_profile $ pyenv update
$ pyenv install 2.7 $ pyenv versions * system (set by /home/xxx/.pyenv/version) 2.7
1. 创建虚拟python环境
$ pyenv virtualenv 2.7 v_py27 $ pyenv verions * system (set by /home/xxx/.pyenv/version) 2.7 v_py27
2. activate和deactivate
$ pyenv activate v_py27 $ pyenv deactivate
$ pyenv gobal v_py27