我在执行yum -y install nc命令的时候出现如下报错

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

cannot import name partial

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, May  3 2017, 07:55:04)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]

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

ansible远程执行 ansible -i ./hosts all -m ping 的时候也有个报错

10.4.38.129 | FAILED! => {

"changed": false,

"module_stderr": "Shared connection to 10.4.38.129 closed.\r\n",

"module_stdout": "\r\nTraceback (most recent call last):\r\n  File \"/home/xtwh/.ansible/tmp/ansible-tmp-1552962762.09-256674951838735/AnsiballZ_command.py\", line 113, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/xtwh/.ansible/tmp/ansible-tmp-1552962762.09-256674951838735/AnsiballZ_command.py\", line 105, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/xtwh/.ansible/tmp/ansible-tmp-1552962762.09-256674951838735/AnsiballZ_command.py\", line 44, in invoke_module\r\n    from ansible.module_utils import basic\r\n  File \"/tmp/ansible_command_payload_ZJtc3_/ansible_command_payload.zip/ansible/module_utils/basic.py\", line 67, in <module>\r\n  File \"/usr/lib64/python2.7/locale.py\", line 19, in <module>\r\n    import functools\r\n  File \"/usr/lib64/python2.7/functools.py\", line 10, in <module>\r\n    from _functools import partial, reduce\r\nImportError: cannot import name partial\r\n",

"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",

"rc": 1

}

以上报错是同一台服务器,判断为python的函数库出问题

解决方案

#cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)

#python -V
Python 2.7.5

将问题主机的/lib64/python2.7目录备份,找一台没问题的服务器,同目录下的所有文件拷贝过来,就解决问题了

yum安装的时候报错,关于python的函数库的更多相关文章

  1. yum安装Development Tools报错问题

    yum安装Development Tools报错问题 我们通过yum安装Development Tools开发组工具的时候,有时可能会遇到如下报错信息. [root@superdesktop ~]# ...

  2. keepalived yum安装后启动报错解决

    [root@centos8 ~]yum install keepalived -y [root@centos8 ~]systemctl start keepalived.services [root@ ...

  3. Cenots 7 通过Yum 安装Node.js 报错问题

    环境:CentOS Linux release 7.3.1611 (Core) 安装报错信息: [cenots7@localhost ~]$ sudo yum -y install npm Loade ...

  4. 利用yum安装时,报错 [Errno 256] No more mirrors to try.

    问题: [root@gg ~]# yum install -y perl-DBD-MySQL  Loaded plugins: product-id, refresh-packagekit, secu ...

  5. yum安装zabbix故障报错

    装zabbix时报错 [root@zabbix ~]# rpm -ivh zabbix-server-mysql-2.2.3-1.el6.x86_64.rpm zabbix-web-mysql-2.2 ...

  6. python 3.5.2安装mysql驱动报错

    python 3.5.2安装mysql驱动报错 python 3.5.2安装mysql驱动时出现如下异常: [root@localhost www]# pip install mysql-connec ...

  7. 【python】python安装tensorflow报错:python No matching distribution found for tensorflow==1.12.0

    python安装tensorflow报错:python No matching distribution found for tensorflow==1.12.0 python版本是3.7.2 要安装 ...

  8. LINUX下编译安装PHP各种报错大集合

    本文为大家整理汇总了一些linux下编译安装php各种报错大集合 ,感兴趣的同学参考下. nginx1.6.2-mysql5.5.32二进制,php安装报错解决: 123456 [root@clien ...

  9. open-falcon ---安装Dashboard时候报错"SSLError: The read operation timed out"

    在部署open-falcon环境过程中,安装Dashboard时候报错"SSLError: The read operation timed out".如下: [root@open ...

随机推荐

  1. ansible笔记(8):常用模块之系统类模块(二)

    ansible笔记():常用模块之系统类模块(二) user模块 user模块可以帮助我们管理远程主机上的用户,比如创建用户.修改用户.删除用户.为用户创建密钥对等操作. 此处我们介绍一些user模块 ...

  2. PHP header 允许跨域请求

    2018-1-29 17:36:14 星期一 header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Methods ...

  3. Redis持久化存储(AOF与RDB两种模式)

    Redis中数据存储模式有2种:cache-only,persistence; cache-only即只做为“缓存”服务,不持久数据,数据在服务终止后将消失,此模式下也将不存在“数据恢复”的手段,是一 ...

  4. java泛型类型变量能调用的方法

    public class Person { } public class Student extends Person{ private String name; public Student(Str ...

  5. 使用JUnit进行类的测试(一)

    首先是测试的一些常用标注: @Test:执行测试的方法 @Before & @After : 在 测试的方法 “前” 或者 “后” 被唤醒 -Initialization -Release r ...

  6. Confluence 6 导入一个 Confluence 站点

    有下面 2 种类方法可以导入一个站点 - 通过上传一个文件或者从你 Confluence 服务器上读取一个目录.上传文件仅仅是针对一个小站点的情况.为了取得最好的导入结果,我们推荐你从服务器上的目录上 ...

  7. Java 本周四、五的相关研究——Excel 的文件管理(数据库初步)

    日期:2018.9.28 星期五 博客期:013 说到这里,就二话不多说了!这次研习的是与Excel表相关联的方法 1.导入jar包(需要自己下载) 2.AccountManager类的实现(关键看非 ...

  8. Rational Rose 2007下载、安装和破解

    一.文件下载 (1)DAEMON Tools Lite(虚拟光驱)下载地址 链接:https://pan.baidu.com/s/19L1FT6T1MlyhkfXyobd26A 提取码:drfs (2 ...

  9. 微信小程序简单介绍 一

    一 组件及api网址: 组件 :https://developers.weixin.qq.com/miniprogram/dev/component/view.html api:https://dev ...

  10. ajax执行成功后,在success回调函数中把后台返回的list还原到html的table中

    需求描述:前台通过onclick触发ajax,到后台返回一个list(json格式的),把list插入到html的table中. 思路简介: ̄□ ̄|| 刚开始的时候,是没有思路的,就卡在了,怎么把 a ...