Aasible中cryptography兼容性报错解决办法

1 Ansible中使用ansible --version查看版本,报错信息如下:

ERROR! Unexpected Exception, this is probably a bug: (cryptography 0.8. (/usr/lib64/python2./site-packages), Requirement.parse('cryptography>=1.1'))
the full traceback was: Traceback (most recent call last):
File "/usr/bin/ansible", line , in <module>
mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
File "/usr/lib/python2.7/site-packages/ansible/cli/__init__.py", line , in <module>
from ansible.inventory.manager import InventoryManager
File "/usr/lib/python2.7/site-packages/ansible/inventory/manager.py", line , in <module>
from ansible.plugins.loader import inventory_loader
File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", line , in <module>
from ansible.parsing.utils.yaml import from_yaml
File "/usr/lib/python2.7/site-packages/ansible/parsing/utils/yaml.py", line , in <module>
from ansible.parsing.yaml.loader import AnsibleLoader
File "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/loader.py", line , in <module>
from ansible.parsing.yaml.constructor import AnsibleConstructor
File "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/constructor.py", line , in <module>
from ansible.parsing.vault import VaultLib
File "/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py", line , in <module>
from cryptography.hazmat.backends import default_backend
File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/backends/__init__.py", line , in <module>
import pkg_resources
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line , in <module>
parse_requirements(__requires__), Environment()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line , in resolve
raise VersionConflict(dist,req) # XXX put more info here
VersionConflict: (cryptography 0.8. (/usr/lib64/python2./site-packages), Requirement.parse('cryptography>=1.1'))

2 分析报错原因:

最后一句Requirement.parse('cryptography>=1.1')),得知cryptography的版本过低,需要升级,安装cryptography需要通过pip安装,所以需要先安装pip。

3 pip安装

下载:wget https://files.pythonhosted.org/packages/69/81/52b68d0a4de760a2f1979b0931ba7889202f302072cc7a0d614211bc7579/pip-18.0.tar.gz
解压:tar -zxvf pip-18.0.tar.gz
进入目录:cd pip-18.0
安装:python setup.py install

4 安装wheel

下载:wget https://files.pythonhosted.org/packages/2a/fb/aefe5d5dbc3f4fe1e815bcdb05cbaab19744d201bbc9b59cfa06ec7fc789/wheel-0.31.1.tar.gz
解压:tar -zxvf wheel-0.31..tar.gz
进入目录:cd wheel-0.31./
安装:python setup.py install

5 安装cryptography

下载:wget https://files.pythonhosted.org/packages/87/e6/915a482dbfef98bbdce6be1e31825f591fc67038d4ee09864c1d2c3db371/cryptography-2.3.1-cp27-cp27mu-manylinux1_x86_64.whl
安装:pip install cryptography-2.3.-cp27-cp27mu-manylinux1_x86_64.whl

6. 测试是否还有问题

[root@]# ansible --version
ansible 2.6.
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2./site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7. (default, Nov , ::) [GCC 4.8. (Red Hat 4.8.-)]

Aasible中cryptography兼容性报错解决办法的更多相关文章

  1. ZABBIX安装过程中relocation error报错解决办法

    错误提示: /usr/sbin/zabbix_server: relocation error: /usr/sbin/zabbix_server: symbol mysql_next_result, ...

  2. spring boot jpa 使用update 报错解决办法

    在spring boot jpa 中自定义sql,执行update操作报错解决办法: 在@Query(...)上添加 @Modifying@Transactional注解

  3. R语言安装openxl包报错解决办法

    在R语言中使用openxlsx包,会报错 解决办法就是: 下载安装Set-Rtool,安装时注意勾选对话框 然后在R中运行以下代码: Sys.setenv("R_ZIPCMD" = ...

  4. springboot x.x.x RELEASE pom 第一行报错解决办法

    springboot x.x.x RELEASE pom 第一行报错解决办法 在pom.xml 文件的properties中加入maven jar插件的版本号 <properties> & ...

  5. sphinx :undefined reference to `libiconv' 报错解决办法

    sphinx :undefined reference to `libiconv' 报错解决办法   2013-11-30 21:45:39 安装sphinx时不停报错...郁闷在make时报错,错误 ...

  6. sysctl -P 报错解决办法

    sysctl -P 报错解决办法问题症状修改 linux 内核文件 #vi /etc/sysctl.conf后执行sysctl  -P 报错error: "net.bridge.bridge ...

  7. sysctl -P 报错解决办法 error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key

    error: "net.bridge.bridge-nf-call-ip6tables" is an unknown keyerror: "net.bridge.brid ...

  8. Authentication token manipulation error报错解决办法

    Authentication token manipulation error报错解决办法 #参考http://blog.163.com/junwu_lb/blog/static/1916798920 ...

  9. npm install 报错解决办法

    npm install 报错解决办法 原因是因为node_modules可能有意外改动,导致依赖库不完整,删除项目下的node_modules,在你的项目目录下,重新执行npm install,这会重 ...

随机推荐

  1. JS数据的基本类型

    字符串   String 数字    Number 布尔    Boolean Null     空 Undefined Object   对象  Array 数组   json   function ...

  2. Python基础2--Python简单数据类型

    python简单数据类型 1 list list的创建,使用[] a_list = [‘a’, ’b’, ‘c’] print a_list print a_list[0] #a 如果去list的最后 ...

  3. RESTful Service API 常见问题解决方案

    REST 风格的优秀设计应该像下面这些: - GET /users 获取所有用户 - GET /users/1234 获取ID为1234的用户 - POST /users 创建一个新用户 - PUT ...

  4. 基于NEO的私链(Private Blockchain)

    1.准备工作 1.NEO-GUI 2.NEO-CLI 3..NET Core Runtime (不能是2.x版本,官方建议是1.12,实际上我用1.14也是没有问题的) 4.四台windows操作系统 ...

  5. web(三)html标签

    标签的层级特性 闭合的html标签内可以包含一个或多个子标签,因此html的标签是一个多叉树的数据结构,多叉树的根是html标签. 标签的属性描述 每个标签都具备一组公用或当前标签独有的属性,属性的作 ...

  6. java的异常抛出和String类常用方法

    一.异常抛出 异常是程序的异种非错误的意外情况,分为运行期异常(RuntimeException)和编译期异常(CheckedExcption) 处理异常可以用try——catch或自定义 impor ...

  7. mysql 数据查询全讲

    数据查询 涉及到DQL(Data Query Language)是sql语句的一类 本文全面介绍了mysql下 select 语句的各种查询方式:普通查询,模糊查询,查询排序,分页查询,聚合函数查询  ...

  8. Mac 终端添加代码到SVN

    从SVN拉取代码步骤: 1.cd  /Users/mark/zkh/Work/BC/(本地路径) 2.svn checkout  https://192.168.2.99/svn/bc_android ...

  9. 【Java】将字节转换成十六进制、BCD码输出

    public class HexUtils { public static void main(String[] args) { byte []out = { 0, 1, 2, 3, 4, 5, 6, ...

  10. golang图片裁剪和缩略图生成

    直接贴代码了 package main import ( "errors" "fmt" "image" "image/gif&qu ...