首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >ansible运行报错CryptographyDeprecationWarning解决

ansible运行报错CryptographyDeprecationWarning解决

作者头像
loong576
发布2020-09-15 10:37:22
4.2K0
发布2020-09-15 10:37:22
举报
文章被收录于专栏:运维ABC运维ABC

前言:ansible运行报错

/usr/lib64/python2.7/site-packages/cryptography/__init__.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  CryptographyDeprecationWarning

环境说明:

主机名

操作系统版本

python版本

python3版本

pip版本

pip3版本

ansible

Centos 7.6.1810

Python 2.7.5

Python 3.6.8

pip 20.2.2(python 2.7)

pip 20.2.2(python 3.6)

一、安装ansible

[root@ansible ~]# yum -y install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.9.9-1.el7.ans.noarch.rpm 
image-20200911163851455
image-20200911163851455

使用yum方式安装ansible,指定安装ansible版本为2.9.9

二、运行ansible

运行ansible时有如下提示

[root@ansible ~]# ansible --version
/usr/lib64/python2.7/site-packages/cryptography/__init__.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  CryptographyDeprecationWarning,
ansible 2.9.10
  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.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Apr  2 2020, 13:16:51) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
image-20200911171554621
image-20200911171554621

虽然这个提示不影响使用,但是对于有强迫症的我来说是不可接受的

三、问题解决

1.卸载ansible

[root@ansible ~]# yum remove ansible
image-20200911164310947
image-20200911164310947

2.使用pip3重新安装ansible

[root@ansible ~]# pip3 install xlrd -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
[root@ansible ~]# mkdir ~/.pip
[root@ansible ~]# touch ~/.pip/pip.conf
[root@ansible .pip]# more pip.conf 
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host = pypi.douban.com
[root@ansible .pip]# pip3 install ansible==2.9.9
image-20200911164538282
image-20200911164538282

使用pip3重新安装ansible,重装后问题解决

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-09-11 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一、安装ansible
  • 二、运行ansible
  • 三、问题解决
    • 1.卸载ansible
      • 2.使用pip3重新安装ansible
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档