No module named yum Error

Source: Internet
Author: User

On centos, yum is a very useful and powerful tool. After some software upgrades in the system, especially after python upgrades, yum is unavailable.

This error message appears.

[Html]
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
Current version of Python, which is:
2.7.2 (default, Nov 8 2012, 23:03:00)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)]
 
If you cannot solve this problem yourself, please go
The yum faq:
Http://wiki.linux.duke.edu/YumFaq

The error message is that the python version does not match. Modify the default python version of the yum tool.
[Html]
Vi/usr/bin/yum
Open the script file
[Html]
#! /Usr/bin/python
Import sys
Try:
Import yum
.......
Change
[Html]
#! /Usr/bin/python2.4
Import sys
Try: www.2cto.com
Import yum
Failed t ImportError:
Because python is upgraded or installed, you can specify a new version.

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.