سؤال

I have a problem with changing python version,I'm using centos6 and i need to change the python version from 2.6 to 2.7.

[root@master Downloads]# which python
/usr/bin/python
[root@master Downloads]# which python2.7
/usr/local/bin/python2.7

How can i use python2.7 as default,or change the path of python to 2.7?

هل كانت مفيدة؟

المحلول

Now my system is like this:

$ ls -la /usr/bin/python
lrwxrwxrwx. 1 root root 7 Oct  1  2012 /usr/bin/python -> python2
$ ls -la /usr/bin/python2
lrwxrwxrwx. 1 root root 9 Oct  1  2012 /usr/bin/python2 -> python2.7
$ ls -la /usr/bin/python2.7
-rwxr-xr-x. 1 root root 10768 Jul 24  2012 /usr/bin/python2.7

You want to do this I think:

sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python

So that /usr/bin/python -> /usr/bin/python2.7

But I can not use yum and update my system as Klaus Warzecha pointed out.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top