I installed Python 2.7 and pointed /usr/bin/python to /usr/local/bin/python2.7

After installing Python 2.7, I get the following error message every time I use yum

> sudo yum install setuptools
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.2 (default, Dec 25 2011, 19:13:04) 
[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)]

If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://wiki.linux.duke.edu/YumFaq

How do I get yum working with Python 2.7 on CentOS?

link|improve this question

33% accept rate
2  
You should do something about your accept rate! A 14% accept rate really encourages people to ignore your requests. – Frands Hansen Dec 26 '11 at 4:43
feedback

2 Answers

You don't get yum working with Python 2.7. Instead, you need to have to have 2.7 installed too, but leave 2.4 where it is to avoid breaking e.g. yum.

Alfred Chiesa wrote a guide walking through this process. Check it out and see if that can help you accomplish what you need.

link|improve this answer
feedback

Quite simply - don't point /usr/bin/python to any other python. Instead, if you want to use python2.7 just modify your path to put /usr/local/bin first.

In general, you shouldn't touch anything in /usr/{bin,lib...} other than in /usr/local

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.