LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   problem when run yum (No module named yum) (https://www.linuxquestions.org/questions/linux-distributions-5/problem-when-run-yum-no-module-named-yum-761805/)

ezak 10-14-2009 06:56 AM

problem when run yum (No module named yum)
 
I have problem while run yum

Code:

# 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 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.4.3 (#1, Oct 14 2009, 01:52:50)
[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

and when import yum from python

Code:

# python
Python 2.4.3 (#1, Oct 14 2009, 01:52:50)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yum
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named yum

Code:

# rpm -qa | grep yum
yum-3.2.19-18.el5.centos
yum-fastestmirror-1.1.18-2.fc10
yum-metadata-parser-1.1.2-2.el5

Code:

# rpm -qa | grep python
python-numeric-23.7-2.2.2
python-docs-2.4.3-1.1
gnome-python2-applet-2.16.0-2.el5
libselinux-python-1.33.4-5.el5
gnome-python2-desktop-2.16.0-2.el5
gnome-python2-2.16.0-1.fc6
gnome-python2-gtksourceview-2.16.0-2.el5
gnome-python2-gconf-2.16.0-1.fc6
gamin-python-0.1.7-8.el5
gnome-python2-libegg-2.14.2-6.el5
gnome-python2-gnomevfs-2.16.0-1.fc6
python-elementtree-1.2.6-5
python-urlgrabber-3.1.0-5.el5
gnome-python2-gnomeprint-2.16.0-2.el5
python-2.4.3-21.el5
libxml2-python-2.6.26-2.1.2.7
python-sqlite-1.1.7-1.2.1
python-ldap-2.2.0-2.1
gnome-python2-bonobo-2.16.0-1.fc6
dbus-python-0.70-7.el5
gnome-python2-extras-2.14.2-6.el5
audit-libs-python-1.6.5-9.el5
python-iniparse-0.2.3-4.el5
rpm-python-4.4.2.3-9.el5

Code:

# ls /usr/local/bin/ | grep python
python*
python2.4*

don't know how to solve this problem
and thanks for advice

flokip 10-14-2009 07:46 PM

I see that there are files from Fedora 6 which are no longer suported.
Are you using centos or fedora and which version.

ezak 10-15-2009 05:59 AM

Quote:

Originally Posted by flokip (Post 3719578)
I see that there are files from Fedora 6 which are no longer suported.
Are you using centos or fedora and which version.

Centos

flokip 10-15-2009 08:17 PM

I have never used centos.
In fedora then as root
#yum update yum
updates yum
see http://www.fedorafaq.org/#installsoftware
Are you not using old software or from fedora 6 and fedora 5

knudfl 10-16-2009 04:04 AM

@ flokip : CentOS 5.x is based on Fedora 6,
thus containing a few packages marked 'fc6'

"No module named yum"
.. I do not know any module 'yum.py'.

If yum is trashed it may not be able to reinstall itself.

May be replace manually with the command # rpm -Uvh <package>

> > yum packages, example i386 address
http://mirror.centos.org/centos/5.3/os/i386/CentOS/
updates
http://mirror.centos.org/centos/5.3/updates/i386/RPMS/
.. but no 'update's for yum*
.....


All times are GMT -5. The time now is 12:30 AM.