一、pyenv 安裝html
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
如果安裝失敗,則 手動將代碼當下來安裝,我在centos 6.6 python2.6.6下安裝不成功,報 環境變量沒配置上去。後面用了 https://gist.github.com/ysaotome/7956676 的腳本python
#!/bin/zsh # pyenv install for CentOS 6.5 x86_64 yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel git clone git://github.com/yyuu/pyenv.git ~/.pyenv export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)" cat << _PYENVCONF_ >> ~/.bash_profile export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)" _PYENVCONF_ pyenv install 2.7.6 pyenv versions pyenv shell 2.7.6 pyenv global 2.7.6 pyenv versions pyenv rehash
二、 安裝 pyenv-virtualenvc++
git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
參考資料:git
一、http://www.it165.net/pro/html/201405/13603.html 用pyenv和virtualenv搭建單機多版本python虛擬開發環境github
二、https://github.com/yyuu/pyenvsql
三、 https://gist.github.com/ysaotome/7956676 pyenv install for CentOS 6.5 x86_64shell
四、https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/ anaconda鏡像centos
五、 https://github.com/yyuu/pyenv-virtualenvbash