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?

| improve this question | | | | |

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.

| improve this answer | | | | |
  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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