易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 729|回复: 1
收起左侧

CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python

[复制链接]
发表于 2023-6-15 01:00:01 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
[root@jms_server src]# ansible --version, s5 |( T0 ?- j( z: l3 h
/usr/local/lib/python3.6/site-packages/ansible/parsing/vault/__init__.py:41: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
& c, z1 o% E3 C% ^  from cryptography.exceptions import InvalidSignature! V) r4 ?. _9 O# Y+ Y. \# `
ansible 2.9.2
. Z7 x! x! C3 W5 M/ Q  config file = None
" H' v* m: r4 Z  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
$ k* ~' z2 X4 q+ [7 x6 A. t  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
: F: |; l5 W8 m: r9 M, A2 s  executable location = /usr/local/bin/ansible
* \7 b: u+ X% P- M# Z  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
3 G" V) v; N+ p# F4 e3 G( b[root@jms_server src]# ansible --versionvim ^C5 J: e- T$ O4 D5 E
[root@jms_server src]# vim /usr/local/lib/python3.6/site-packages/ansible/parsing/vault/__init__.py
5 V. H/ p# X0 H3 ?[root@jms_server src]# vim /usr/local/lib/python3.6/site-packages/ansible/parsing/vault/__init__.py0 `' Y& f, {2 ?) H+ i5 r4 [8 t, N" W
[root@jms_server src]# pip install -I exceptions
6 \0 B8 W( Q& R7 w" X' tERROR: Could not find a version that satisfies the requirement exceptions (from versions: none)
5 v% \( o. I4 E9 o  S6 `ERROR: No matching distribution found for exceptions
3 Y4 L  u5 E# Y: G[root@jms_server src]# pip install  exceptions , u' H' h% a+ r3 D
ERROR: Could not find a version that satisfies the requirement exceptions (from versions: none)
% S3 d. @: D5 y0 S; n2 ]ERROR: No matching distribution found for exceptions
# _% ~, P! E/ b9 M; [0 q3 F$ }[root@jms_server src]# pip install  exception
& [* N$ S, f+ v! _4 s% lCollecting exception, ]$ n0 ~* G8 y, ?- Q0 R
  Downloading exception-0.1.0-py2.py3-none-any.whl (5.7 kB)5 f6 o: L9 N8 V% C& H( ~
Collecting six
3 t. `6 u9 ~& C0 j7 E! W2 ~& H" G8 Y  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
8 }# v5 _5 a2 U$ ^4 F. u! j* fCollecting argparse8 Y- x9 {: P# w# S
  Downloading argparse-1.4.0-py2.py3-none-any.whl (23 kB)
/ e6 l5 l! L; O9 m* w) aInstalling collected packages: six, argparse, exception' T- W2 G2 W# v" K( r  f
Successfully installed argparse-1.4.0 exception-0.1.0 six-1.16.07 X, J* H; p1 Q& W
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv# x) b5 p% L8 O
[root@jms_server src]# ansible --version
0 [4 [( g3 |, n7 v1 u' w* o9 T/usr/local/lib/python3.6/site-packages/ansible/parsing/vault/__init__.py:41: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.$ B' C9 }, b- N! X% h
  from cryptography.exceptions import InvalidSignature4 T: m* E, V* J! }
ansible 2.9.2
4 k% ?' t. k$ Z/ U5 q4 ]  config file = None
" T; }* |" |/ `- L7 I- g  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']: Y! G8 r# i. A# s3 M
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible& O5 U' o8 g' d
  executable location = /usr/local/bin/ansible7 L1 k3 }0 t- s% E$ O1 B# k+ w& |7 H' {
  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
& q; s: l1 {* h0 h) ~5 z
0 W& U* ^- M. @& Q* X  Z8 {* }! x& t5 m# A! ?
[root@jms_server src]# pip show cryptography
3 N/ _2 T$ n3 @, ~Name: cryptography
+ @/ y5 \( ^$ W8 g# i6 Z" _6 nVersion: 40.0.2
& t' Y, K6 d  y1 d/ l" \# [2 w" ESummary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.7 D& I, R7 T1 r% A: R0 n+ l
Home-page: https://github.com/pyca/cryptography. l6 q- i; s4 o: _, |5 h" m
Author: The Python Cryptographic Authority and individual contributors
' L3 r; l, x, s4 o$ [7 BAuthor-email: cryptography-dev@python.org
2 i) q# s& E7 `5 h" T0 {4 VLicense: (Apache-2.0 OR BSD-3-Clause) AND PSF-2.0+ V4 t2 u4 U0 Y/ x% v
Location: /usr/local/lib64/python3.6/site-packages+ U0 `2 l# ?& H" q3 V% g  c
Requires: cffi) m) F4 t6 K7 `* }+ |0 j" u/ y5 @- ?$ i
Required-by: ansible% N% n0 t+ _6 P/ |8 h8 n& R
[root@jms_server_01 src]# pip install -I "cryptography==3.4.8"
# I9 g+ }* g# N1 l0 V" o7 U' Y$ [Collecting cryptography==3.4.82 Z% F/ b/ E8 Y$ S5 s& [1 D
  Downloading cryptography-3.4.8-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)
  J% p6 Y: {4 m, J4 W     |████████████████████████████████| 3.2 MB 862 kB/s            9 x8 O' c# D; w+ g7 b4 G; ^
Collecting cffi>=1.12
) M5 x) w8 o; m% T  Using cached cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (402 kB)$ u" [, a* X5 ?/ t/ I1 g
Collecting pycparser
; E7 s8 f/ X: r# ^4 p/ U& ]  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)% r* W3 G0 |( ?
Installing collected packages: pycparser, cffi, cryptography
. o: @4 N+ [$ Q0 xSuccessfully installed cffi-1.15.1 cryptography-40.0.2 pycparser-2.21
1 x( t2 |; B$ H- ^6 f0 HWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
: n* q) M6 T9 [. n[root@jms_server_01 src]# ansible --version( I% [9 ?5 }) u- Q5 I
ansible 2.9.2
) h6 s) R+ Y& r: T* U6 s- Q" ~  config file = None
5 P+ v6 F8 J$ A) _' e# Z  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']) y# W' J1 w* b9 e% w; H
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
1 G& q5 q' O! ]) I/ |, z  executable location = /usr/local/bin/ansible
1 f3 Z" K# o  e  x  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]1 A4 |( R% `, ~$ a4 ~
8 ?0 r! I- ~9 H
 楼主| 发表于 2023-6-15 01:00:02 | 显示全部楼层
原因:此时版本python 3.6 ;Cryptography 37.04
6 X( T+ v" u, Z" q2 C1 z! t
$ q; h9 s" I! ~1 c解决办法:降版本,降Cryptography至3.4.8,就可以正常运行;# s6 @2 U* ]. z; G. n
/ ?. ~; N# f- z: G# _3 H
                或者升级python3.9 ,高版本的python可以兼容这些冲突' d7 Z# C4 s* a% h" H- I
4 }" C& p* i# \+ R7 ]$ O+ W; C
先查看已经安装的Cryptography版本
" J4 h' N, o& z2 d7 Y$ p% G& G& s: N$ i1 W# u
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-8 20:22 , Processed in 0.046348 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

快速回复 返回顶部 返回列表