找回密码
 注册
查看: 762|回复: 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/ H" S& Y, X. I6 S
/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.
- Y$ y' V% E; Z; F9 I7 i% T' o( E  from cryptography.exceptions import InvalidSignature0 w" w6 o0 V) r% M3 [: M. l" T3 S
ansible 2.9.2
! o8 A# d6 |, p, K* Y! o2 F! B& n/ Q7 Z& r  config file = None
2 [) h6 U- j8 a' M  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
1 G" P. P: k  Y  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
# d2 m+ X3 X0 l! n5 j/ A9 _4 B; K  executable location = /usr/local/bin/ansible3 h. I- B4 L( |% k! I
  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
, X7 ]* z3 |- [! p% m9 T[root@jms_server src]# ansible --versionvim ^C
, M* n, H9 v; l+ s[root@jms_server src]# vim /usr/local/lib/python3.6/site-packages/ansible/parsing/vault/__init__.py& _" @0 W- U; e# H4 V, R8 P$ P
[root@jms_server src]# vim /usr/local/lib/python3.6/site-packages/ansible/parsing/vault/__init__.py
) t# ?4 ~  U& f5 c1 g5 e7 e& J/ Q[root@jms_server src]# pip install -I exceptions / j. k* p- J. h) u2 K5 Z
ERROR: Could not find a version that satisfies the requirement exceptions (from versions: none)
# G( q- |. ?5 W) r3 e* zERROR: No matching distribution found for exceptions
* K% R* M; T! Y  R- A[root@jms_server src]# pip install  exceptions $ ^  Q& i6 ~( \
ERROR: Could not find a version that satisfies the requirement exceptions (from versions: none)
& \8 N2 _" e! c) V) yERROR: No matching distribution found for exceptions
- l" q# t2 s. c0 V( }2 E2 K[root@jms_server src]# pip install  exception$ F* c% Q: ^; o& j0 k
Collecting exception
$ Q6 A/ j: x/ w! D: v  Downloading exception-0.1.0-py2.py3-none-any.whl (5.7 kB); q* c' V2 L: V. _0 t# a7 r/ o! j
Collecting six# F5 d- \' i7 Z- z$ [: D
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)9 H/ y# [7 Q3 j! E# E8 {4 H4 Q
Collecting argparse, d6 @- A" v. Z* k
  Downloading argparse-1.4.0-py2.py3-none-any.whl (23 kB)
% ^6 C2 |8 |9 m  K7 \  ?% J8 @Installing collected packages: six, argparse, exception
& U$ S  C' ?- J1 Q* x; aSuccessfully installed argparse-1.4.0 exception-0.1.0 six-1.16.0
, Q# R+ H$ W5 D  `5 Y6 G$ E$ GWARNING: 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* S% o5 W# A: g9 X7 Y8 a3 H" U/ A: X
[root@jms_server src]# ansible --version" B/ [! |( F- Z: N' C
/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.
, W3 E( N/ p% e  e: P- }8 T  from cryptography.exceptions import InvalidSignature
& l; q. i% ]( a6 W& Aansible 2.9.2
& x* k2 I( V" `5 k  config file = None
2 w6 r0 `- X0 }; y" S4 f( i  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']- n* k# C6 @6 f2 b& G; v
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
& y" X& d5 D. a  D! `$ e, ?  executable location = /usr/local/bin/ansible! a  R) e) |% ^$ V6 S! h% s
  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
6 p2 B1 R  V% j; c8 i1 f
& S1 ~6 n3 e' c; \
/ r7 X2 |: v7 I" R1 l5 y[root@jms_server src]# pip show cryptography
; Y3 Q1 D3 f0 ^. |; EName: cryptography
6 {- l$ p% ?% K3 D% @Version: 40.0.24 h7 E' e$ C, {
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.5 v8 i, k3 N: b3 P$ D/ B, ^1 A
Home-page: https://github.com/pyca/cryptography
; t. Q: Q# {$ {Author: The Python Cryptographic Authority and individual contributors
4 T; B! j+ [4 Q" o: j. ~; u* M5 `* VAuthor-email: cryptography-dev@python.org
% K2 `3 ~( q% X3 O( WLicense: (Apache-2.0 OR BSD-3-Clause) AND PSF-2.0- E1 w+ a6 }: z# O) M7 ^
Location: /usr/local/lib64/python3.6/site-packages" v4 v% J4 R% q3 i
Requires: cffi: I/ t# r- w/ Q& L' y. U
Required-by: ansible$ m. d: G1 g8 o
[root@jms_server_01 src]# pip install -I "cryptography==3.4.8"
0 I: D) w$ t5 ^- nCollecting cryptography==3.4.8
" B: S( w* O2 y) s- b& p  Downloading cryptography-3.4.8-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)
8 T1 ?1 F+ A4 D( n+ T     |████████████████████████████████| 3.2 MB 862 kB/s            3 N7 i5 @3 K$ y. O& ]7 S1 p5 k
Collecting cffi>=1.12+ x# Q, [! E, P, Y% l5 o; n& z
  Using cached cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (402 kB)
2 s2 f; q2 \; d( U2 XCollecting pycparser
! [! g9 @) i$ ^  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)& m. C) S$ q- i+ S$ V
Installing collected packages: pycparser, cffi, cryptography: i- V2 z+ {3 X. j( r
Successfully installed cffi-1.15.1 cryptography-40.0.2 pycparser-2.21
5 I0 {* w" }; s# M% S4 _: IWARNING: 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
4 Y' M$ T/ X9 ~/ h[root@jms_server_01 src]# ansible --version8 E$ i  b$ [- Y9 c
ansible 2.9.2( m& g; ?2 y# v& q# r. Y1 ^) r
  config file = None
% F! I. S' j  @3 z4 K2 r  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
% q" v; Y5 l5 e5 K; l, g  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
4 T4 U$ R! M) U; i! l% \6 Q# Q& ~# c% ~  executable location = /usr/local/bin/ansible) S% d" G1 w" Y, C% Z( H
  python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
1 t- d5 k, ~1 M. ~( _9 z
, ^! d% _( G9 A) y: w

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-6-15 01:00:02 | 显示全部楼层
原因:此时版本python 3.6 ;Cryptography 37.04 " K6 A1 o* U5 R) d9 g7 Q5 B9 y* s

( W$ p' B* w1 C5 I解决办法:降版本,降Cryptography至3.4.8,就可以正常运行;2 j* {3 X& o. n0 a; @$ s5 E

% }  v  ^0 W' J7 D/ W                或者升级python3.9 ,高版本的python可以兼容这些冲突
% I" t. O0 T2 s3 f0 M
! m) b" \' d& H8 l先查看已经安装的Cryptography版本6 f( A1 {5 R" D$ ]
" {& z% ~) p( t/ H$ A3 ]* f
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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