yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
$ echo ‘export PYENV_ROOT="$HOME/.pyenv"‘ >> ~/.bash_profile
$ echo ‘export PATH="$PYENV_ROOT/bin:$PATH"‘ >> ~/.bash_profile
echo -e ‘if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi‘ >> ~/.bash_profile
exec $SHELL
source ~/.bash_profile
pyenv install -list或(-l)
pyenv install 3.6.5
pyenv install 2.7.14
pyenv versions
pyenv local 3.6.5
pyenv local 2.7.14
pyenv uninstall 3.6.5
pyenv uninstall 2.7.14
python -m pip xxxxx
原文地址:http://blog.51cto.com/xiaoma90/2103103