美文网首页
ubuntu16.04安装python3.7

ubuntu16.04安装python3.7

作者: 莪从莈爱过伱 | 来源:发表于2020-01-05 22:02 被阅读0次

ubuntu16.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.0

pyenv install 3.7.0 -v

3.1安装完成之后,需要使用如下命令对数据库进行更新:

pyenv rehash

3.2查看已经安装的python版本:

pyenv versions

* system (set by /root/.pyenv/version)

3.7.0

4.设置全局python版本

pyenv global 3.7.0

相关文章

网友评论

      本文标题:ubuntu16.04安装python3.7

      本文链接:https://www.haomeiwen.com/subject/osncactx.html