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.

I've the following problem with yum:

$ 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, Feb 22 2012, 16:06:13) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)]

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

My OS: CentOS release 5.8 (Final)

When trying to install python-elementtree manually from RPM package, it gives the following error:

$ sudo rpm -i http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm
package python-elementtree-1.2.6-7.el4.rf.i386 (which is newer than python-elementtree-1.2.6-5.i386) is already installed

[kenorb@ds-92373 ~/Downloads]$ sudo rpm -i http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm

Related forum threads:

share|improve this question

2 Answers 2

Hmm, is python-elementtree still installed? The cEleementTree module should live in /usr/lib64/python2.4/site-packages/cElementTree.so (/usr/lib/... on 32bit systems). Does that file still exist?

If the package is missing, you can resintall it with rpm:

x86_64:

rpm -i http://mirror.centos.org/centos-5/5/os/x86_64/CentOS/python-elementtree-1.2.6-5.x86_64.rpm

i386:

rpm -i http://mirror.centos.org/centos-5/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm
share|improve this answer
    
Unfortunately doesn't work: package python-elementtree-1.2.6-7.el4.rf.i386 (which is newer than python-elementtree-1.2.6-5.i386) is already installed –  kenorb Jan 28 '13 at 11:11
    
I've posted some answer to my question, but it doesn't work either (but could help for other). –  kenorb Jan 28 '13 at 11:12
    
Thank you for you suggestion, actually this command did work: sudo rpm -iv --force python-elementtree-*.rpm –  kenorb Jan 28 '13 at 11:17
up vote 1 down vote accepted

Solution

Try to download and install python-elementtree manually:

x86_64

wget http://mirrors.usc.edu/pub/linux/distributions/centos/5.8/os/x86_64/CentOS/python-elementtree-1.2.6-5.x86_64.rpm
sudo rpm -Uvh python-elementtree-*.rpm

i386

wget http://mirrors.usc.edu/pub/linux/distributions/centos/5.8/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm
sudo rpm -Uvh python-elementtree-*.rpm

Troubleshooting

Error: 'package python-elementtree-1.2.6-7.el4.rf.i386 (which is newer than python-elementtree-1.2.6-5.i386) is already installed' or similar

Try to replace the package, even it's installed by:

sudo rpm -iv --replacepkgs python-elementtree-*.rpm

or:

sudo rpm -iv --replacefiles python-elementtree-*.rpm

or finally:

sudo rpm -iv --force python-elementtree-*.rpm

See: --replacepkgs: Install the Package Even If Already Installed

share|improve this answer

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.