Ubantu16.04安装Python3.7
1.安装依赖包
sudo apt-get update
sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus
sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev
sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev
sudo apt-get install libssl-dev openssl
sudo apt-get install libffi-dev
2.安装pyenv
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
exec $SHELL -l
3.安装Python3.7
pyenv install 3.7.0 -v
安装完成,更新数据库
pyenv rehash
查看已安装的python版本
pyenv versions
4.设置全局Python版本
pyenv global 3.7.0
Other(pyenv命令)
转自链接