Ubuntu默认已经安装了Python的版本了,不过是Python2的版本。
我们安装好Python3想把他切换为系统默认的版本。
sudo update-alternatives --config python
//显示当前系统中所有的Python版本。
直接输入数字,即可切换为相应的版本号。
这样你甚至可以将自己喜欢的任意版本python安装到任意位置,然后使用update-alternatives
将其设置为系统默认python。
同时,也可使用下面的命令来切换
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3
最后
以上就是儒雅外套最近收集整理的关于若ubuntu下有python2和python3,默认为python2,如何设置python3为默认版本!的全部内容,更多相关若ubuntu下有python2和python3,默认为python2,如何设置python3为默认版本内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复