1, the error information is as follows:
[Root@develop bin]# yum [root@develop local]# yum-y Install Prce There was a problem importing one of the
Python Modules
required to run yum. The error leading to this problem is:
No module named Yum please
install a package which provides this module, or Verify that's the
module is installed correctly.
It's possible that's above module doesn ' t match the current
version of Python, which is:
2.6.1 (r261:67515, Aug 7 11:36:17)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] If you
cannot solve this problem yourself The
Yum FAQ at:
Http://wiki.linux.duke.edu/YumFaq
Error Reason: The error message is described as incompatible with Python that Yum relies on, please install the corresponding Python
2, view Yum version
[Root@develop local]# Rpm-qa |grep Yum
Yum-3.2.8-9.el5.centos.1
Yum-metadata-parser-1.1.2-2.el5
3. View Python version
[Root@develop local]# whereis python
python:/usr/bin/python2.4/usr/bin/python/usr/lib/python2.4/usr/local/bin /python2.6/usr/local/bin/python2.6-config/usr/local/bin/python/usr/local/lib/python2.6/usr/share/man/man1/ Python.1.gz
Sure enough, two versions of Python were installed.
4, execute Python, see the version that uses 2.6.1
[Root@develop local]# python
python 2.6.1 (r261:67515, Aug 7, 11:36:17)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44 ] on linux2
Type ' help ', ' copyright ', ' credits ' or ' license ' for the more information.
>>>
5, guess Yum called the high version of Python.
6, the solution:
Find Yum and Yum-updatest files, and edit this py file
[Root@develop local]# which yum
/usr/bin/yum
[root@develop local]# Vi/usr/bin/yum
[Root@develop local]# Vi/usr/bin/yum-updatest
Will
#!/usr/bin/python
To
#!/usr/bin/python2.4
Then save OK.
If you do not modify/usr/bin/yum, Yum cannot use
If you do not modify/usr/bin/yum-updatest, you will receive the following error
File "/usr/sbin/yum-updatesd", line <module>
Import Dbus
Importerror:no module named Dbus
Of course, after the revision of the PostScript
[Root@localhost google_appengine]#/sbin/service yum-updatesd Restart stopping yum-updatesd
: [FAILED]
Starting yum-updatesd: [ OK ]
Add: Yum is based on Python.