首页 > 代码库 > python模块造成的yum简单报错笔记!

python模块造成的yum简单报错笔记!

[root@node6 yum.repos.d]# yum clean all

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.8 (default, Sep  5 2016, 17:22:38) 

[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

  


[root@node6 yum.repos.d]#

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

大概是自定义安装python造成

[root@node6 yum.repos.d]# python

Python 2.7.8 (default, Sep  5 2016, 17:22:38) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>>

修改过来:

[root@node6 ~]# cd /usr/bin/

[root@node6 bin]# mv python.bak python

mv:是否覆盖"python"? y

[root@node6 bin]# python

python         python2.6.bak  python2.bak    

[root@node6 bin]# python

Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[root@node6 bin]# yum clean all

已加载插件:fastestmirror

Cleaning repos: base elrepo epel epel-debuginfo epel-source extras ren updates

清理一切

Cleaning up list of fastest mirrors

[root@node6 bin]#

yum list

#############################################

可以使用!

本文出自 “renzhiyuan@chinacfsc.com” 博客,请务必保留此出处http://renzhiyuan.blog.51cto.com/10433137/1847094

python模块造成的yum简单报错笔记!