升級完python2.7.11後問題

安裝完python2.7.11後用了幾天挺好,但是今天用yum的時候發現了問題

[root@template yum.repos.d]# yum list
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.11 (default, Apr  7 2016, 21:10:55)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)]

If you cannot solve this problem yourself, please go to
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

上網查了一下才知道原來yum是需要python環境的,python2.7.11太新了,需要改回舊的版本

which yum

whereis python
vim /usr/bin/yum

 

將#!/usr/bin/python 改爲#!/usr/bin/python2.6

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章