找回密码
 注册
查看: 761|回复: 1

CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-6-15 01:00:01 | 显示全部楼层 |阅读模式
[root@jms_server src]# ansible --version
" h1 t0 i7 E$ b) d: x/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.. l0 Z3 ^1 V1 e; a7 ~
  from cryptography.exceptions import InvalidSignature4 M- K- Q/ B1 M& ?) P! x9 H0 i: a$ B
ansible 2.9.21 a( L6 ]2 }" K# P
  config file = None+ \$ M% k& D) W. y, e
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']; Q% d9 H- g, V. m. k# r( o$ u' s
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
8 b1 \/ V1 C5 w% G( K  executable location = /usr/local/bin/ansible
, y+ I0 k- r9 Y0 R- v8 S  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]* |% s$ i: O! F: Z8 H
[root@jms_server src]# ansible --versionvim ^C
( @! R* m3 R1 [) v) ?[root@jms_server src]# vim /usr/local/lib/python3.6/site-packages/ansible/parsing/vault/__init__.py
1 V6 g6 `( ?. z[root@jms_server src]# vim /usr/local/lib/python3.6/site-packages/ansible/parsing/vault/__init__.py
- s2 R1 P# o8 h3 g1 E5 c% Z[root@jms_server src]# pip install -I exceptions - ]7 d3 i' @1 H5 v
ERROR: Could not find a version that satisfies the requirement exceptions (from versions: none)+ W; e% y0 Y3 {
ERROR: No matching distribution found for exceptions2 p9 H3 F4 j' [' y
[root@jms_server src]# pip install  exceptions
! [- Z& s1 t6 F0 s4 q% |+ [' pERROR: Could not find a version that satisfies the requirement exceptions (from versions: none): g4 i4 Q& |; g! |
ERROR: No matching distribution found for exceptions) q( @, e: V9 I' `" K. ]+ Z: W- G" R0 R
[root@jms_server src]# pip install  exception7 K/ r% d, f" N
Collecting exception4 X# D* H9 f* h0 [4 N" W! J2 b
  Downloading exception-0.1.0-py2.py3-none-any.whl (5.7 kB)2 @7 ^8 `- i# M$ n2 M& A& Q3 n
Collecting six
+ A* W/ B/ ~2 `( R# _/ i  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
7 _( u, ^3 j& R# z- y; dCollecting argparse
; @$ f( B" V! {* a0 n% P8 K  Downloading argparse-1.4.0-py2.py3-none-any.whl (23 kB)
. Y+ r' [  L9 jInstalling collected packages: six, argparse, exception* C/ N' X9 T' S5 |* J2 H4 U$ T
Successfully installed argparse-1.4.0 exception-0.1.0 six-1.16.0
) K1 W& g" Y: g, w) M: WWARNING: 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/ l# o4 ]9 y) `; A' @
[root@jms_server src]# ansible --version- I3 Q! x, ]# U9 V" C( w1 Q
/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.* r' s& Q. L" L) m
  from cryptography.exceptions import InvalidSignature3 s" u/ B; t+ X
ansible 2.9.2
8 D$ W9 P+ X: b& L% x. F/ I  config file = None5 M/ y: [. H( q
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
0 L- g; |: D  c& J+ g7 ]2 i  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
" b( c- v" U5 P* K, S& e7 d  executable location = /usr/local/bin/ansible
$ O3 l1 |- e6 \6 K3 m4 j  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]. Q0 ~9 M* M$ @$ ^( H

' z: K% z% d( S- n+ q. n' r6 B0 d; S+ A, D
[root@jms_server src]# pip show cryptography* d. |' \; N! Y
Name: cryptography( w+ x% z" ^, ]: _# {
Version: 40.0.2
& |& r: g2 O& N  X" |Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.7 @$ w! s6 _- O0 B* W
Home-page: https://github.com/pyca/cryptography
! a0 A3 O/ ~) f9 y7 QAuthor: The Python Cryptographic Authority and individual contributors! B6 a' f1 }" Y- [
Author-email: cryptography-dev@python.org
9 R( v+ `. Y+ s4 s4 NLicense: (Apache-2.0 OR BSD-3-Clause) AND PSF-2.0* C0 V+ M! ?# t
Location: /usr/local/lib64/python3.6/site-packages
' u2 i, ]5 q. u6 |Requires: cffi
) M$ n6 A$ D8 L8 }5 z) }- S2 }Required-by: ansible& Z( H. w; {# h0 Q- A1 w! O" ^: f
[root@jms_server_01 src]# pip install -I "cryptography==3.4.8"  a1 {* m( K7 m9 F% B' B
Collecting cryptography==3.4.8" {7 b4 d6 G% D# y& ]  Y( `+ E
  Downloading cryptography-3.4.8-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)* _& X& g! k" Z% ]9 A
     |████████████████████████████████| 3.2 MB 862 kB/s            
3 o5 {9 u9 [1 ?/ [( eCollecting cffi>=1.12
1 A- ?2 c) E7 @6 W  Using cached cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (402 kB)+ F1 ]- T: t  |- ]% t
Collecting pycparser0 ?/ h0 A* q% A# A
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)) C) t# w/ E) d5 V4 d: c
Installing collected packages: pycparser, cffi, cryptography
  U) k3 q/ _: [' `& }' ySuccessfully installed cffi-1.15.1 cryptography-40.0.2 pycparser-2.21" x# d& n; i% h: }
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
2 `& O# o2 i% F( d0 i[root@jms_server_01 src]# ansible --version: r" x6 K9 V% Q* N
ansible 2.9.27 {, X5 P6 E' A/ b4 t2 K
  config file = None2 B9 A8 ~3 K6 a6 K! Q* F, j* k
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']' [0 a2 X( y! x" O/ [- V
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible" [2 s  N! T* F( x8 l: z9 o
  executable location = /usr/local/bin/ansible
, j0 J9 q  [; c; c  N: s! f  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]# q1 F7 J" h6 u( A) n( ?1 f
8 k6 _' f6 k4 F% ^! L: B; l

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-6-15 01:00:02 | 显示全部楼层
原因:此时版本python 3.6 ;Cryptography 37.04 3 i( k5 v* x& s# T0 D# F$ l* [

! y; Z, q4 ^; k; ]; j, w解决办法:降版本,降Cryptography至3.4.8,就可以正常运行;/ x) z+ ]( D. c2 n4 H
0 X/ o. p* _+ H
                或者升级python3.9 ,高版本的python可以兼容这些冲突* {$ m6 ]& G' s1 l9 t2 a; z8 n* U4 F

& m- P5 p+ S! g- m$ C/ s- Z  ~9 |先查看已经安装的Cryptography版本
7 w6 n) G& u% J6 C5 [4 W5 k* i  H1 H0 ^+ v- U$ I
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:43 , Processed in 0.020186 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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