开发者社区> 问答> 正文

使用YUM安装软件提示报错在网上搜寻很多帖子均未能解决问题 ?报错

[root@iZ94y7aaiclZ tar]# whereis python
python: /usr/bin/python2.6 /usr/bin/python /usr/lib/python2.6 /usr/lib64/python2.6 /usr/local/bin/python2.7-config /usr/local/bin/python /usr/local/bin/python2.7 /usr/local/lib/python2.7 /usr/include/python2.6 /usr/share/man/man1/python.1.gz
[root@iZ94y7aaiclZ tar]# yum
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.3 (default, Apr 27 2016, 14:59:31)

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

If you cannot solve this problem yourself, please go to

the yum faq at:
http ://yum.baseurl.org/wiki/Faq

使用YUM安装软件提示报错, 在网上搜寻很多帖子均未能解决问题.

有说是python的版本问题(比如同时安装了两个版本, 导致版本不匹配), 也找了资料进行配置, 但是还是不行.

yum我也重新装了一次, 但是还是无法解决问题.

求给位大虾帮忙解决问题, 感激不尽.

展开
收起
爱吃鱼的程序员 2020-06-23 14:27:17 572 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    TherewasaproblemimportingoneofthePythonmodules
    requiredtorunyum

    你是不是安装过python
    如果是得话那是因为python被覆盖的原因

    看看yum的配置文件
    yum配置文件(sudovi/usr/bin/yum)。
    文件头部的#!/usr/bin/python改成具体的程序吧

    2020-06-23 14:27:36
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
15分钟打造你自己的小程序更新版 立即下载
SEO学习步骤 立即下载
代码未写,漏洞已出——谈谈设计不当导致的安全问题 立即下载