ubuntu16.04中将Python默认的设置成Python3

ubuntu16.04中将Python默认的设置成Python3

直接执行这两个命令即可:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150

如果要切换到Python2,执行:
sudo update-alternatives --config python

vscode 将自己的解释器版本更换到python3
ubuntu16.04中将Python默认的设置成Python3_第1张图片
2017-05-07 17-01-52屏幕截图.png

在pythonPath这一行,更改一下地址就好。

你可能感兴趣的:(ubuntu16.04中将Python默认的设置成Python3)