參考:https://github.com/yyuu/pyenv-installer
python
$ 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環境
git
$ pyenv virtualenv 2.7 v_py27 $ pyenv verions * system (set by /home/xxx/.pyenv/version) 2.7 v_py27
2. activate和deactivate github
$ pyenv activate v_py27 $ pyenv deactivate
$ pyenv gobal v_py27