如何选择在 Linux 上运行的 python 版本?

Ale*_*man 6 python linux

我正在使用的Linux版本默认有python 2.6,我们在一个单独的文件夹中安装了2.7。

如果我想运行 .py 脚本,如何告诉它使用 2.7 而不是默认值?

Ken*_*nly 3

使用update-alternatives --config pythonpython2.7从选择中进行选择。
如果需要删除它,请使用update-alternatives --remove python /usr/bin/python2.7.