ubuntu python版本切换_ubuntu18.04 python版本切换
update-alternatives是ubuntu系統(tǒng)中專門維護(hù)系統(tǒng)命令鏈接符的工具,通過它可以很方便的設(shè)置系統(tǒng)默認(rèn)使用哪個(gè)命令、哪個(gè)軟件版本,比如,我們在系統(tǒng)中同時(shí)安裝了python2.7和python3.6兩個(gè)版本,而我們又希望系統(tǒng)默認(rèn)使用的是python3.6,那怎么辦呢?通過update-alternatives就可以很方便的實(shí)現(xiàn)了。
1.更新替代列表(管理員權(quán)限下)
命令格式:update-alternatives --install
is the symlink pointing to /etc/alternatives/.
(e.g. /usr/bin/pager)
is the master name for this link group.
(e.g. pager)
is the location of one of the alternative target files.
(e.g. /usr/bin/less)
is an integer; options with higher numbers have higher priority in
automatic mode.
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
2、查看替代列表:
update-alternatives --list python
3、切換:
update-alternatives --config python
總結(jié)
以上是生活随笔為你收集整理的ubuntu python版本切换_ubuntu18.04 python版本切换的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python选课系统_【精选】在Mona
- 下一篇: python tushare获取股票数据