美文网首页程序员
ubuntu升级python

ubuntu升级python

作者: pillows | 来源:发表于2019-08-13 21:16 被阅读0次

1、添加ppa仓库

sudo add-apt-repository ppa:jonathonf/python-3.6

2、升级apt

sudo apt-get update

3、安装指定的python版本

sudo apt-get install python3.6

4、将系统默认的python软链接指到新的python上

# 这一句将系统默认的python3软链接指向了python3.5版本,最后面的1代表了优先级
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1

# 这一句类似于上面的操作,这两句将系统默认的软链接python3指向了两个python版本
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2

5、切换python版本

sudo update-alternatives --config python3
这里选择python版本

相关文章

网友评论

    本文标题:ubuntu升级python

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