安装 Python 2.7 打破了“yum”

use*_*363 2 python centos yum

我安装了Python 2.7,并指出/usr/bin/python/usr/local/bin/python2.7

安装Python 2.7后,每次使用都会出现以下错误信息 yum

> sudo yum install setuptools
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.2 (default, Dec 25 2011, 19:13:04) 
[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)]

If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://wiki.linux.duke.edu/YumFaq
Run Code Online (Sandbox Code Playgroud)

我如何yum在 CentOS 上使用 Python 2.7?

小智 10

您可以编辑对 python 的 yum (/usr/bin/yum) 调用,例如:

#!/usr/bin/python2.4

先备份 ;-)