"No module named yum" 和 Python 2.7
"No module named yum" with Python 2.7
我的项目需要使用 Python 2.7。但是在安装了Python之后,我无法使用模块yum。我有这个错误:
[root@nexus-chat2 .synapse]# 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.5 (default, Feb 19 2018, 14:55:04)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
你知道我该如何解决吗?我使用 CentOS 6
yum
模块不是库存 Python 模块。它需要为您在系统上安装的任何版本的 Python 显式构建和安装。对于 CentOS 6,系统 Python 是 python 2.6(并且 yum
模块将默认可用)。
如果您想让 yum
模块可用于您的 Python 2.7 安装,您需要针对您的 Python 2.7 安装构建 yum
,这可能成为一项 non-trivial 任务。
最简单的解决方案是 (a) 只使用 Python 2.6 或 (b) 升级到更新的发行版。
我的项目需要使用 Python 2.7。但是在安装了Python之后,我无法使用模块yum。我有这个错误:
[root@nexus-chat2 .synapse]# 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.5 (default, Feb 19 2018, 14:55:04)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
你知道我该如何解决吗?我使用 CentOS 6
yum
模块不是库存 Python 模块。它需要为您在系统上安装的任何版本的 Python 显式构建和安装。对于 CentOS 6,系统 Python 是 python 2.6(并且 yum
模块将默认可用)。
如果您想让 yum
模块可用于您的 Python 2.7 安装,您需要针对您的 Python 2.7 安装构建 yum
,这可能成为一项 non-trivial 任务。
最简单的解决方案是 (a) 只使用 Python 2.6 或 (b) 升级到更新的发行版。