我在执行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. 制作ecc证书(linux命令行)

    生成ECC证书.Debian:/home/test# openssl ecparam -out EccCA.key -name prime256v1 -genkeyDebian:/home/test# ...

  2. Hibernate search使用示例(基础小结-注解方式)

    (对于项目环境配置,一直没怎么看过.这次经历里从基础环境搭建到hibernate search示例的完成) 1.首先创建project,选择了web project. 2.导入hibernate se ...

  3. LabVIEW--为控件添加说明信息

    之前只知道为VI添加说明信息(在VI的属性里面添加,快捷键ctrl+I 打开),今天知道了控件也可以添加说明信息,这样就方便了许多,极大的提高了程序的可读性.

  4. git命令(版本控制之道读书笔记)

    1.在Windows中安装完git后,需要进行一下配置:$ git config --global user.name "zhangliang"$ git config --glo ...

  5. 监听本机tcp和udp的端口

    #!/bin/bash #tcp part port1=`netstat -an|grep LISTEN|egrep "0.0.0.0|:::"|awk '/^tcp/ {prin ...

  6. CodeCraft-19 and Codeforces Round #537 (Div. 2) 题解

    传送门 D. Destroy the Colony 首先明确题意:除了规定的两种(或一种)字母要在同侧以外,其他字母也必须在同侧. 发现当每种字母在左/右边确定之后,方案数就确定了,就是分组的方案数乘 ...

  7. poj1562 Oil Deposits 深搜模板题

    题目描述: Description The GeoSurvComp geologic survey company is responsible for detecting underground o ...

  8. RCNN--目标检测

    原博文:http://www.cnblogs.com/soulmate1023/p/5530600.html 文章简要介绍RCNN的框架,主要包含: 原图-->候选区域生成-->对每个候选 ...

  9. 【Shared Server Mode】测试调整shared_servers参数对数据库的影响

    本文来源于:secooler  的 <[Shared Server Mode]测试调整shared_servers参数对数据库的影响> 关于Shared Server模式的配置方法请参见文 ...

  10. Confluence 6 管理协同编辑 - 最大编辑者的限制

    我们限制为最多 12 个用户可以同时对一个页面进行编辑.这个意味着当一个页面已经有 12 个用户正在编辑了,13 个用户是不能进入编辑界面的,直到 12 个用户中有一个用户已经离开了. 系统管理员可以 ...