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

kolla-genpwd ImportError: cannot import name _get_backend kolla-ansible

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-6-16 11:39:39 | 显示全部楼层 |阅读模式
[root@openstack-gnocchi ~]# kolla-genpwd
1 ^5 Y. Z0 s- m& y, j* zTraceback (most recent call last):4 X1 U# h0 B0 A- J- o* `: U
  File "/usr/bin/kolla-genpwd", line 5, in <module>
+ g* \, ^0 e" @5 [' y( Y    from kolla_ansible.cmd.genpwd import main
3 Y4 Y: Q7 x* D# t4 [7 y8 S8 ]  File "/usr/lib/python2.7/site-packages/kolla_ansible/cmd/genpwd.py", line 24, in <module>
) C9 {" Z, b3 g2 t0 g" r) X    from cryptography.hazmat.primitives import serialization. {! u1 k4 ?3 ~: p3 V
  File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/serialization/__init__.py", line 7, in <module>
8 `! d6 H2 d) e3 n, |+ G    from cryptography.hazmat.primitives.serialization.base import (5 Z; Y+ q% U/ ~' Z/ q. Q. A
  File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/serialization/base.py", line 13, in <module>! u6 [! T+ p) g- T
    from cryptography.hazmat.backends import _get_backend
: o' _) e1 ]8 b3 Y5 t+ }; `" `ImportError: cannot import name _get_backend& e" r0 u& }: x- v3 \* A, ?

: {' h  l/ G3 y6 w% L8 {$ r) B& Q解决办法:
. e! l$ Q+ Y- @. A, N使用pip命令安装py. E8 c& O# e( r; g" ~
[root@openstack-gnocchi ~]# pip install -I cryptography: v6 `" A/ h5 j2 o; V" f
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
. F8 f* e% z  ^. b! c7 N7 zLooking in indexes: http://mirrors.aliyun.com/pypi/simple/! J, x" p( H  S4 h, K0 i
Collecting cryptography2 g# V6 ^* C! }, H! p) Q
  Downloading http://mirrors.aliyun.com/pypi/packages/bf/a0/c630e9e3b7e7ea2492db1ca47ef7f741ef1a09f19c6642ef1a16ce996d9b/cryptography-3.3.2-cp27-cp27mu-manylinux2010_x86_64.whl (2.6 MB)
  V, p/ }& ]% r5 R8 z     |████████████████████████████████| 2.6 MB 447 kB/s ' S8 D/ j3 y/ g: l$ [  U0 B0 \
Collecting six>=1.4.1
, f$ y3 @8 G' U8 D  Downloading http://mirrors.aliyun.com/pypi/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl (11 kB)
  S5 `9 ^; X/ J8 H% o7 xCollecting enum34; python_version < "3"
' W8 B4 G- t/ h7 e" g* y  Downloading http://mirrors.aliyun.com/pypi/packages/6f/2c/a9386903ece2ea85e9807e0e062174dc26fdce8b05f216d00491be29fad5/enum34-1.1.10-py2-none-any.whl (11 kB); a/ p: t$ x2 U
Collecting ipaddress; python_version < "3"
: H5 z3 X# v# H8 @  Downloading http://mirrors.aliyun.com/pypi/packages/c2/f8/49697181b1651d8347d24c095ce46c7346c37335ddc7d255833e7cde674d/ipaddress-1.0.23-py2.py3-none-any.whl (18 kB)5 M  j4 D4 q  o& {6 R
Collecting cffi>=1.12
, E, D' t  [# K+ `, G4 k  Downloading http://mirrors.aliyun.com/pypi/packages/26/28/fb01ff898aa7c93e4774799b3dc0a3693cfee48c5ea4e524ce30e6b10e7e/cffi-1.15.0-cp27-cp27mu-manylinux1_x86_64.whl (393 kB)0 p7 Z: p  W- G; |) Q( Q5 D/ g  k
     |████████████████████████████████| 393 kB 478 kB/s   j! d  X  X3 z) k& [  _8 ]; q
Collecting pycparser/ @; c7 Y9 [' c7 V$ w. Y
  Downloading http://mirrors.aliyun.com/pypi/packages/62/d5/5f610ebe421e85889f2e55e33b7f9a6795bd982198517d912eb1c76e1a53/pycparser-2.21-py2.py3-none-any.whl (118 kB)* K- ]& b( U( q+ X" V- Y
     |████████████████████████████████| 118 kB 476 kB/s
& L' o2 l& L2 H2 g/ x% n1 n* zInstalling collected packages: six, enum34, ipaddress, pycparser, cffi, cryptography2 N. a' J9 p4 B9 [7 V) D3 V
Successfully installed cffi-1.15.0 cryptography-3.3.2 enum34-1.1.10 ipaddress-1.0.23 pycparser-2.21 six-1.16.08 \- m( _, \/ o2 ]4 o' p
[root@openstack-gnocchi ~]# kolla-genpwd
5 |  G" i- S# @  W9 r; T0 ~& R- s/usr/lib/python2.7/site-packages/kolla_ansible/cmd/genpwd.py:22: 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 the next release.
8 p1 S7 _! P) V- ?7 c& G  from cryptography.hazmat.backends import default_backend3 D+ O! q$ M0 N9 F5 P" {( j
* g  }: p5 D4 u1 v7 Q1 y$ h: q

& {6 u# m! Z9 w5 z然后就又调到了这个问题上:
, j% A& p* @" w2 zhttp://www.bbs168x.cn/forum.php?mod=viewthread&tid=2240&extra=0 }$ o' c5 [, J" B

/ Y# `4 n; ], u9 c9 ]1 N6 b( Y" A' q9 L" O+ r. W8 N$ a# a

70

主题

73

回帖

1201

积分

网站编辑

积分
1201
发表于 2023-9-7 15:28:15 | 显示全部楼层
生成密码的命令,需要保证cryptography逐渐正常。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 01:05 , Processed in 0.021395 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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