Ubuntu16.04下升级Python到3.6

 

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

 

sudo apt-get update
sudo apt-get install python3.6

 

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1

update-alternatives命令可以修改系统默认命令的软链指向,参考这里,上面两句指令就是修改了系统默认的/usr/bin/python3 的软链指向,指向了两个位置,最后面的1和2是优先级。

 

通过以下命令,可以切换Python3的指向

sudo update-alternatives --config python3

 

 

参考:

https://blog.csdn.net/YubaoLouisLiu/article/details/88594309

 

posted @ 2019-08-29 00:31  anobscureretreat  阅读(1532)  评论(0编辑  收藏  举报