Skip to content

CentOS5 – yum – cElementTree – Python

So you updated using yum, and lo and behold yum is no longer working. An attempt to use yum gives you the following:


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

No module named cElementTree

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, Jul 27 2009, 17:57:39)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]

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

I had this error on a CentOS5 VPS. Now, the fix for this is simple enough. It involves removal of some packages, then re-installing those packages we removed.


rpm -e yum yum-fastestmirror python-urlgrabber python-sqlite python-elementtree
wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.22-20.el5.cento...
wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.1...
wget http://mirror.centos.org/centos/5/os/i386/CentOS/python-urlgrabber-3.1.0...
wget http://mirror.centos.org/centos/5/os/i386/CentOS/python-sqlite-1.1.7-1.2...
wget http://mirror.centos.org/centos/5/os/i386/CentOS/python-elementtree-1.2....
rpm -i yum-3.2.22-20.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm python-urlgrabber-3.1.0-5.el5.noarch.rpm python-sqlite-1.1.7-1.2.1.i386.rpm python-elementtree-1.2.6-5.i386.rpm

Of course bear in mind the architecture and versions (depends when you are reading this post!) of the files.

This should get you up and running again.

No comments yet

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.