参考:https://blog.csdn.net/xunan003/article/details/81710996

 

ubuntu18.04 :

 

sudo  apt-get install python3-pip 

 

 sudo  apt-get install python3

 

 

此方法适用于ubuntu和debian 其他发行版本没有测试。正常情况基于ubuntu与debian开发的发行版本都支持

打开终端分别输入下面两条命令:

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

原文链接:https://blog.csdn.net/heww/article/details/92803938

然后再终端输入:

python

如果无误,此时python版本应该切换到默认的python3了。

如果需要重新切换回python只需要在终端输入:

sudo update-alternatives  --config python

然后选者你需要的python版本,输入序号回车即可

相关文章:

  • 2021-12-19
  • 2022-12-23
  • 2021-12-27
  • 2021-05-26
  • 2022-02-09
  • 2022-12-23
  • 2022-01-14
猜你喜欢
  • 2021-05-05
  • 2021-10-29
  • 2021-12-06
  • 2022-02-22
  • 2022-02-07
  • 2022-01-10
  • 2021-04-11
相关资源
相似解决方案