我是靠谱客的博主 矮小月饼,这篇文章主要介绍ubuntu 下切换python版本,现在分享给大家,希望可以做个参考。

查python版本:

ls /usr/bin/python

把2.7版本和3.6版本的python分别加入列表中

update-alternatives --install /usr/bin/python python /usr/bin/python2.7  1  
update-alternatives --install /usr/bin/python python /usr/bin/python3.6  2
 

列出已经配置版本

update-alternatives --list python

切换系统默认的python版本了 

update-alternatives --config python

HP:~/Project/$ update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).

  Selection    Path                Priority   Status
------------------------------------------------------------
  0            /usr/bin/python3.8   2         auto mode
  1            /usr/bin/python2.7   1         manual mode
* 2            /usr/bin/python3.8   2         manual mode

Press <enter> to keep the current choice[*], or type selection number:

最后

以上就是矮小月饼最近收集整理的关于ubuntu 下切换python版本的全部内容,更多相关ubuntu内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(101)

评论列表共有 0 条评论

立即
投稿
返回
顶部