LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (http://www.linuxquestions.org/questions/fedora-35/)
-   -   yum - cElementTree - Python (http://www.linuxquestions.org/questions/fedora-35/yum-celementtree-python-485194/)

WhatsOnYourBrain 09-20-2006 02:02 AM

yum - cElementTree - Python
 
hi. something i installed w/ Yum caused yum to stop working. the error is:
Code:

@localhost ~]$ 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, Jun 13 2006, 11:46:08)
[GCC 4.1.1 20060525 (Red Hat 4.1.1-1)]

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

when i went to the YumFaq, i found related info, and upon executing the suggestions there:
Code:

@localhost ~]$ python
Python 2.4.3 (#1, Jun 13 2006, 11:46:08)
[GCC 4.1.1 20060525 (Red Hat 4.1.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yum
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 35, in ?
    import comps
  File "/usr/lib/python2.4/site-packages/yum/comps.py", line 18, in ?
    from cElementTree import iterparse
ImportError: No module named cElementTree

how do i fix this? i've read the suggestions for
Code:

rpmbuild --rebuild yum*.src.rpm
but i don't know how to get to doing that part.

thanks!!

sn68 09-20-2006 02:27 AM

You can find the latest installed software with "rpm -qa --last" and uninstall it(if rpm packages were installed)
OR
You could try removing yum with rpm -e yum, then downloading the latest package from http://rpm.pbone.net/index.php3/stat...oarch.rpm.html
and installing it with rpm -i yum-2.6.1-0.fc5.noarch.rpm
If it doesn't install, atleast it will tell you what dependencies it is missing, which again could be downloaded & installed

Edit -(Got from another forum) to get yum to work install these from same repository

yum
python-urlgrabber
python-sqlite
python-elementtree

apparently yum misses the dependency "elementtree" and error message gives out "celementtree"

WhatsOnYourBrain 09-20-2006 07:01 AM

Quote:

Originally Posted by sn68
Edit -(Got from another forum) to get yum to work install these from same repository

yum
python-urlgrabber
python-sqlite
python-elementtree

how does one go about "[installing] these from same repository"?
i don't know the syntax... it may look like i do from things i've quoted here, but those are usually directly copied from other sites. i'm not sure how to just do it based on the names of the files. (sorry. it's the thickness of my skull getting in the way...)

thanks!
and thanks, sn68 for finding this for me! very awesome!!

EDIT: from additional research, i've tried this -- what should i do... rpm -e everything listed here?
Code:

[root@localhost ~]# rpm -Uvh http://download.fedora.redhat.com/pub/fedora/linux/core/updates/5/i386/yum-2.6.1-0.fc5.noarch.rpm
Retrieving http://download.fedora.redhat.com/pub/fedora/linux/core/updates/5/i386/yum-2.6.1-0.fc5.noarch.rpm
Preparing...                ########################################### [100%]
        package yum-2.6.1-0.fc5 is already installed
[root@localhost ~]# rpm -e yum
error: Failed dependencies:
        yum >= 2.5.3 is needed by (installed) pirut-1.0.3-0.fc5.noarch
        yum >= 2.4 is needed by (installed) yumex-1.0.2-1.0.fc5.noarch
        yum is needed by (installed) mach-0.9.0-1.fc5.i386
        yum >= 2.2.0 is needed by (installed) kyum-0.7.5-3.fc5.i386
[root@localhost ~]#


sn68 09-20-2006 12:26 PM

To uninstall yum you will need to uninstall yumex, pirut, kyum & mach (these can be installed once you get your yum going) so once you uninstall these and python-urlgrabber, python-sqlite, python-elementtree, you can download these packages from fedora download site or http://rpm.pbone.net and install with rpm.
(rpm -e packagename, do man rpm at terminal to get more info & press q to exit man pages)
Before you start working with yum, you will need to disable one of the conflicting repositories.Can you post what all repositories you have installed? (contents of /etc/yum.repos.d/)

WhatsOnYourBrain 09-21-2006 12:31 AM

hey there, sn68! here's what i've got for the repos:
Code:

-rw-r--r-- 1 root  187 Sep 17 14:10 dries.repo
-rw-r--r-- 1 root  840 Mar 14  2006 fedora-core.repo
-rw-r--r-- 1 root 1549 Mar 14  2006 fedora-development.repo
-rw-r--r-- 1 root  780 Mar 14  2006 fedora-extras-development.repo
-rw-r--r-- 1 root  763 Mar 14  2006 fedora-extras.repo
-rw-r--r-- 1 root  486 Mar 14  2006 fedora-legacy.repo
-rw-r--r-- 1 root  790 Mar 14  2006 fedora-updates.repo
-rw-r--r-- 1 root  865 Mar 14  2006 fedora-updates-testing.repo
-rw-r--r-- 1 root  354 Jun 28  2005 freshrpms.repo
-rw-r--r-- 1 root 1904 Jul 18 17:49 livna-devel.repo
-rw-r--r-- 1 root 1809 Sep 18 08:23 livna.repo
-rw-r--r-- 1 root 1808 Sep 18 08:22 livna.repo~
-rw-r--r-- 1 root  466 Sep 18 03:57 livna.repo.rpmorig
-rw-r--r-- 1 root 2003 Jul 18 17:49 livna-testing.repo
-rw-r--r-- 1 root  249 Sep 17 14:09 macromedia.repo
-rw-r--r-- 1 root  663 Sep 18 08:22 mirrors-rpmforge
-rw-r--r-- 1 root  662 Jun  5 05:46 mirrors-rpmforge~
-rw-r--r-- 1 root  399 Sep 18 08:22 rpmforge.repo
-rw-r--r-- 1 root  398 Jun  5 05:46 rpmforge.repo~

sorry about the permissions and all-- but i thought perhaps the dates there would serve to show what i've customized since i installed this drive after my primary drive became inaccessible not even a week ago.
since my last post here, i've done the following, and am currently in this state at the time of posting:
Code:

[root@localhost ~]# rpm -e yum
error: Failed dependencies:
        yum >= 2.5.3 is needed by (installed) pirut-1.0.3-0.fc5.noarch
        yum >= 2.4 is needed by (installed) yumex-1.0.2-1.0.fc5.noarch
        yum is needed by (installed) mach-0.9.0-1.fc5.i386
        yum >= 2.2.0 is needed by (installed) kyum-0.7.5-3.fc5.i386
[root@localhost ~]# rpm -e pirut
[root@localhost ~]# rpm -e yumex
warning: /etc/yumex.profiles.conf saved as /etc/yumex.profiles.conf.rpmsave
[root@localhost ~]# rpm -e kyum
[root@localhost ~]# rpm -e mach
[root@localhost ~]# rpm -e yum
warning: /etc/yum.conf saved as /etc/yum.conf.rpmsave
[root@localhost ~]# rpm -Uvh http://download.fedora.redhat.com/pub/fedora/linux/core/updates/5/i386/yum-2.6.1-0.fc5.noarch.rpm
Retrieving http://download.fedora.redhat.com/pub/fedora/linux/core/updates/5/i386/yum-2.6.1-0.fc5.noarch.rpm
Preparing...                ########################################### [100%]
  1:yum                    ########################################### [100%]
[root@localhost ~]# yum install pirut
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, Jun 13 2006, 11:46:08)
[GCC 4.1.1 20060525 (Red Hat 4.1.1-1)]

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

so where does this put me in the scheme of things that you had in mind, sn68? thanks for your help!!

sn68 09-21-2006 02:25 AM

Hi
Thanks for posting repositories. Apparently dries, rpmforge & livna repositories dont mix. So now disable dries.repo, rpmforge.repo. That will leave fedora-core, fedora-extras, fedora-updates, livna, freshrpms & macromedia repositories enabled
Thereafter uninstall following packages as well

python-urlgrabber
python-sqlite
python-elementtree

Now download the above packages from following links and install with "rpm -i"
http://rpm.pbone.net/index.php3/stat...oarch.rpm.html
http://rpm.pbone.net/index.php3/stat....i386.rpm.html
http://rpm.pbone.net/index.php3/stat....i386.rpm.html

now your yum should be able to run properly

Edit - To be on safer side disable all repos you installed on sep 17 & 18
To disable a repo, open terminal
>su
pwd
>gedit /etc/yum.repos.d/livna.repo
change "enabled=1" to "enabled=0"

WhatsOnYourBrain 09-21-2006 04:50 AM

cool...gotcha! hey, sn68, you do a real good job of helping. maybe it's coincidence, but maybe it's instinct too. what i mean is-- something about your inquiry and assessment allowed us to put aside whether i was educated enough about this stuff to pull it off or not (albeit, i suppose a real beginner might not have known how to post some of that stuff). it's not easy trying to make suggestions when you don't know what the other person knows (i speak from experience as a guitar instructor-- the most difficult assessment period being that of taking on a new student who already knows how to play. it's like "okay. do something. i've gotta figure out what you know; what you need to know, etc."... i dunno... just felt like mentioning that. something you might want to be attentive of and cultivate-- get a gig doing "e-Learning courses"!
:)

anyway... very cool-- i'm going to check this stuff out, and see where it gets me! i'll post back n tell the results, but i really feel like we're on the right track! woo hoo!
(btw... look for a PM from me)
edit: oops... i guess there's no PM'ng here ;)

WhatsOnYourBrain 09-21-2006 05:08 AM

what to do when i get this?:
rpm -e python-urlgrabber
error: Failed dependencies:
urlgrabber is needed by (installed) yum-2.6.1-0.fc5.noarch
python-urlgrabber is needed by (installed) createrepo-0.4.6-1.fc3.rf.noarch

is there a way to "Force" it?

would that be rpm -e --force (appname)?

WhatsOnYourBrain 09-21-2006 05:43 AM

woohoo!! awesome. i assume that, since yum is in the process of doing the "yum -y update", that i'm good to go, right?

:)

thanks so much for your generous, attentive help!!

sn68 09-21-2006 07:05 AM

Hi
Its good to know that we were able to get "yum" back on track, this particular "fault" so to say occured because incompatible packages were installed from repositories which should not have been used together.
More info at http://stanton-finley.net/fedora_cor...s.html#Warning

regards
sn68

WhatsOnYourBrain 09-23-2006 12:08 PM

hey there-- i don't want to bother w/ this thread too much more-- but in case it might help someone else, plus i am a bit curious:

it might not have even been a day later that Yum quit working again-- same error. i've been going off of the StantonFinley rec. (ie. according to his list, to my knowledge, i guess that's using rpmforge instead of livna, and then freshrpms dries, and macromedia.)

this time i removed libstdc++so7.i386, which i installed because of a Firefox XPI i wanted. it was supposed to be libstdc++so5.i386, but that didn't show up specifically-- so i installed the libstdc++so7.i386 which warns that it's unstable and, in so many words, untrustable. it was after i first installed that item that yum first went down (probably not immediately after), but i forgot to uninstall it this past fix.

we'll see what happens now. i haven't enabled the "SF repos" yet, but i will cause they've never given me problems in the past. i just wanted to report that little bit.

thanks again, sn68

smad 11-17-2006 11:17 PM

work around
 
sorry post 1

smad 11-17-2006 11:18 PM

sorry post 2

smad 11-17-2006 11:19 PM

sorry post 3

smad 11-17-2006 11:19 PM

My RHEL4 was broken and got the anoying python error!
I was able to correct the problem this way.

1- So first download on (http://linux.duke.edu/projects/yum)

>wget http://linux.duke.edu/projects/yum/d....2.2-1.src.rpm

2- Then remove the old installation and rebuild to old yum version (2.2.2.1)
>rpm -e yum
>rpmbuild --rebuild yum-2.2.2-1.src.rpm
>rpm -e python-urlgrabber
>rpm -i /usr/src/redhat/RPMS/noarch/yum-2.2.2-1.noarch.rpm

3- Update from DAG and play with /etc/yum.conf files

To add the DAG packages (prebuilt for RHEL4) repository to CentOS:
>cd /etc/yum.repos.d/
>wget http://soundlinuxtraining.com/portal.../misc/dag.repo

These packages are signed with a GPG key so you will need to import the key
( as root ).

>rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

If creating problem, comment all other repo's (in /etc/yum.conf and /etc/yum.repo.d/*.repo)

4- Update packages

>yum -y update --exclude=yum

Elsewhere, yum with urlgrabber will be updated and won't work again...


All times are GMT -5. The time now is 02:07 PM.