采用update-alternatives 切换版本
1.查看Ubuntu系统已安装的python版本及当前使用的python版本

2.设置update-alternatives 切换python版本
update-alternatives –list python
显示Python代替版本信息

执行命令安装
update-alternatives –install /usr/bin/python python /usr/bin/python2.7 1 update-alternatives –install /usr/bin/python python /usr/bin/python3.5 2

查看默认版本

上述命令中我们设置 /usr/bin/python3.5 的优先级为2 所以设置3.5为默认
再次显示Python代替版本信息

切换版本
update-alternatives –config python

GitHub链接: https://github.com/lichangke/LeetCode
个人Blog: https://lichangke.github.io/
欢迎大家来一起交流学习