我想使用一些需要Python的较新软件2.6,并且我们目前已将它们2.4同时2.6安装在专用的CentOS服务器上,如下所示:
2.6
2.4
$ which python /usr/local/bin/python $ which python2.6 /usr/bin/python2.6 $ which python2.4 /usr/local/bin/python2.4 $ ls -l /usr/local/bin/py* -rwxr-xr-x 1 root root 81 Aug 9 2007 /usr/local/bin/pydoc -rwxr-xr-x 2 root root 3394082 Aug 9 2007 /usr/local/bin/python -rwxr-xr-x 2 root root 3394082 Aug 9 2007 /usr/local/bin/python2.4
如何切换2.6为默认使用python?
python
作为根:
ln -sf /usr/bin/python2.6 /usr/local/bin/python
这将从/ usr / local / bin / python-> /usr/bin/python2.6建立符号链接(替换旧的硬链接)。