ubuntu系统下更改默认的python版本

参考博客:

https://www.jianshu.com/p/9d3033d1b26f

ubuntu安装了python2.X和python3.X版本,默认版本是2.x.

python -V     //查看python的所有版本
python2 -V    //查看python2
python3 -V    //查看python3
whereis python3    //查看python3的路径

1.首先删除python2.x

rm /usr/lib/python

2.建立指向python3.x的软连接(首先查看python3是否安装好)

ln -s /usr/bin/python3.5 /user/bin/python        //本人的是python3.5

3.测试安装成果

python3 -V

效果如果:

发布了188 篇原创文章 · 获赞 62 · 访问量 18万+

猜你喜欢

转载自blog.csdn.net/Code_7900x/article/details/88747220