How to change the default version of python in a l

2019-01-25 09:51发布

I have multiple versions of python installed in ubuntu (precise) for various reasons and uses. I have python 2.7 and python 2.6. I need to make python 2.6 the default and not python 2.7. I updated python symlink to point to python2.6. That will only give me commandline access straight to python2.6. but when I install some package from aptitude, it goes straight to python2.7 compatible stuff because somewhere in the OS, its sees that as the default. How should I change this ?

P.S : I know the workaround of installing from package's source code. But its not easy to get the source code always and not all are generous.

1条回答
Animai°情兽
2楼-- · 2019-01-25 10:11

On Ubuntu and other Debian-derived distributions, the proper way to define which Python version to run system-wide is with sudo update-alternatives --config python. See also http://www.stylesen.org/python_27_debian_squeeze_60

查看更多
登录 后发表回答