I am trying to reinstall yum in CentOS. Because I made some mistake by removing python.

so I got error as follows
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named rpm

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.4.3 (#1, Nov 11 2010, 13:34:43) 
[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:

And then I followed some tutorial from http://www.electrictoolbox.com/install-yum-with-rpm-on-centos/ But I got an error while trying to install python libs

error: Failed dependencies:
    python < 2.4.3-32.el5 conflicts with python-libs-2.4.3-43.el5.i386

How can I fix this?


rpm -qa|grep python
  • Can you state your centos version? Also a list of the currently installed relevant packages eg. python and related packages, yum etc along with versions. also, why were you trying to remove python? May 25, 2011 at 6:11
  • I'm new at Linux. I wanna update python with new lib, and then I remove the existing python using yum remove python. I don't know that there are so much library depend on python May 25, 2011 at 16:31
  • Not sure what you mean by "python with new lib". Did you want a new library? In general python versions are tightly coupled the the rest of the system, and cannot be changed without breakage. There seems to be a version mismatch. Is your system perhaps out of date? I first suggest you try to find a version of python-libs that your installed python will work with. once you have your system working, I suggest checking for updates. May 25, 2011 at 16:43

2 Answers 2


I checked on the web, and (on the assumption that you are using Centos 5.5, which you have not confirmed), 2.4.3-32 corresponds to 5.5, but 2.4.3-43 corresponds to 5.6.

You presumably want to update to 5.6. So get python 2.4.3-43 and upgrade to that using rpm -Uvh. This link will probably work. You can use a direct link if you want. If that works, try installing python-libs as you did earlier.


Using just RPM, remove the old libraries and reinstall all the Python 2.4 interpreter and libraries, including the Python rpm module.

  • I've tried to remove existing python using rpm -e python-2.4.3-27.el5_5.3 But I Got error as follows: error: Failed dependencies: libpython2.4.so.1.0 is needed by (installed) libsemanage-1.9.1-4.4.el5.i386 python(abi) = 2.4 is needed by (installed) rhpl-0.194.1-1.i386 May 25, 2011 at 16:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .