Ubuntu18.04设置默认使用Python3

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/m0_43404744/article/details/92415633

一、默认Python2调整为Python3

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 200

二、默认Python3调整为Python2

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 200
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 100

猜你喜欢

转载自blog.csdn.net/m0_43404744/article/details/92415633