Python upgrade to 2.7.8 causes Yum to run abnormally: No module named Yum

Source: Internet
Author: User

OS version:

[email protected] etc]# cat Redhat-release
Red Hat Enterprise Linux Server Release 5.4 (Tikanga)


---run Yum error

[email protected] ~]# Yum Install dialog

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


Install a package which provides this module, or
Verify the module is installed correctly.


It ' s possible that the above module doesn ' t match the
Current version of Python, which is:
2.7.8 (Default, Jul 16 2014, 08:48:25)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)]


If You cannot solve this problem yourself and go to
The Yum FAQ at:
Http://wiki.linux.duke.edu/YumFaq



[Email protected] ~]# Rpm-qa |grep Yum
Yum-security-1.1.16-21.el5
Yum-updatesd-0.9-2.el5
Yum-metadata-parser-1.1.2-3.el5
Yum-3.2.22-39.0.2.el5

Yum-rhn-plugin-0.5.4-26.0.1.el5


[[email protected] ~]# Whereis python
Python:/usr/bin/python2.4/usr/bin/python/usr/lib/python2.4/usr/include/python2.4/usr/share/man/man1/python.1.gz
[email protected] ~]# which Yum

/usr/bin/yum



[Email protected] ~]# Vi/usr/bin/yum
#!/usr/bin/python2.4----This line needs to be modified to /usr/bin/python2.4
Import Sys
Try
。。。。

"/usr/bin/yum" 32L, 806C written


-----Run Yum again for normal operation

[[email protected] ~]# Yum install list
Loaded Plugins:rhnplugin, security
This system isn't registered with ULN.
ULN support would be disabled.
File:///media/oel/Server/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/media/oel/server/ Repodata/repomd.xml '
Trying other mirror.
Setting up Install Process

No Package list available.




----also updated under/USR/SBIN/YUM-UPDATESD

[Email protected] etc]# VI/USR/SBIN/YUM-UPDATESD
#!/usr/bin/python2.4-tt


---restart service

[Email protected] etc]# service yum-updatesd restart
stopping yum-updatesd: [FAILED]
Starting yum-updatesd: [OK]


Python upgrade to 2.7.8 causes Yum to run abnormally: No module named Yum

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.