Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

yum was working fine till I upgraded Python for the sake of django in my VPS.

It throws exactly this error:

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, Mar 7 2012, 08:41:42) [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)]

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

Why is this happening?

Does it mean I have to reinstall yum?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You should never upgrade the system Python, because there are other tools (like yum!) that depend on it. You should always install a newer Python alongside the system Python, and you should make sure that /usr/bin/python points to the system Python.

You should probably restore the original version of Python (you should be able to grab this from a CentOS mirror and install it using the rpm command), and then install a newer version of Python in an alternate location.

You may also need to re-install yum.

share|improve this answer
    
i did it !!! thanks –  Thale Mar 7 '12 at 3:08
    
I used to alter python SRPM from Fedora for this sake, replacing all references to "python" with "python<version>" (it was python25 in my case) so there'd be no intersecting files/provisions/requirements. –  ivan_pozdeev Mar 7 '12 at 7:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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