This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12368|Reply: 0

[Source] Python multiple versions cause yum to run errors

[Copy link]
Posted on 2/13/2017 3:30:11 PM | | | |
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.7.5 (default, Dec  7 2016, 02:54:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]

If you cannot solve this problem yourself, please go to
the yum faq at:
  http://yum.baseurl.org/wiki/Faq
Error causes:
Error reason: The error message describes that the python that yum depends on does not match, please install the corresponding python.

First, run:


The results showed:

Sure enough, there are two versions of python installed

Run python to see the version using 2.7.5





Guess yum calls a high version of python

Find the yum file, and edit this py file

Outcome:





will


Changed to:



Then save OK.





Previous:Git in action – Commit your local project to github/gitlab
Next:Centos installs the JDK with yum
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com