【发布时间】:2018-10-13 04:00:50
【问题描述】:
我尝试了@yum---no module named yum 和"No module named yum" with Python 2.7 的解决方案,但没有帮助,听起来 yum 模块不是一个普通的 Python 模块,需要针对你的 Python 2.7 安装构建 yum,任何人都可以提供有关如何安装的指导这样做?
机器详情:
[usernames@machine]$ cat /etc/*elease
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Oracle Linux Server release 6.6
Red Hat Enterprise Linux Server release 6.6 (Santiago)
Oracle Linux Server release 6.6
错误:-
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.12 (default, Aug 11 2016, 12:02:22)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
【问题讨论】:
-
你升级python2并覆盖你的系统python了吗?
-
你只是想运行
yum吗? -
@jgritty - 我在我的机器上使用 python 2.7.2,这可能是原因?如何解决这个问题?是的,我正在尝试运行 yum
-
您正在运行 OEL6。您可以从public-yum.oracle.com 获取最新支持的
python和python-libs。用这些发行版库替换python-2.7.2。如果目录/usr/lib/python2.6/site-packages/yum及其内容被清除,您可能还需要重新安装yum。运行rpm -V yum将显示是否有任何文件丢失。
标签: python linux redhat yum rhel