It's possible that's the above module doesn ' t match the current version of Python__python

Source: Internet
Author: User

The following problems may occur when you run Yum:

[Root@centos ~]# Yum
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 the above module doesn ' t match the
Current version of Python, which is:
2.5.4 (r254:67916, Feb 24 2010, 10:03:49)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
If you are cannot solve this problem yourself, please visit http://www.92wiki.com
The Yum FAQ at:
Http://wiki.linux.duke.edu/YumFaq

Reason analysis: please visit http://www.92wiki.com

The CentOS 5.4 system default Python version is 2.4.3 and needs to be upgraded to Python 2.5.4, because Yum package management is written in Python, and just upgrading python alone can cause Yum to be unusable.
The main reason for this is that the newly installed Python does not have the packages that the Yum service relies on.

Workaround: Want to know more:

Find Yum file and edit this py file
[root@centos ~]# which yum
/usr/bin/yum
[Root@centos ~]# vi / Usr/bin/yum
 
To change
#!/usr/bin/python
to:
#!/usr/bin/python2.4
 
and then save OK.

There is also a possibility that the same can lead to the inability to use Yum, that is,/usr/bin python, Python2, python2.4 three files must not change. Theoretically, Yum is just based on the Python language, it has nothing to do with the version, but there are problems in the upgrade process, and I am not very clear about the specific mechanism.  

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.