解决cryptography库报错【DLL load failed while importing _rust】

解决 DLL load failed while importing _rust

python使用库cryptography

当 from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions 时,会报错:

ImportError: DLL load failed while importing _rust: 找不到指定的程序。

问题分析

可能是cryptography的版本不对导致的,本人安装的是42.0.5的版本,查看版本的方法如下

python 复制代码
import cryptography
print(cryptography.__version__)

解决办法

安装低版本的 cryptography

shell 复制代码
pip install cryptography==41.0.2
相关推荐
ShyanZh12 小时前
【Python3基础】02-输入输出与程序运行
python
伞伞悦读12 小时前
【第39期】Python 第三方包安装详解:pip、conda、requirements、版本锁定和镜像源
python·conda·pip
明志数科12 小时前
机器人数据采集过程中五类异常片段的判定与处理
机器学习·机器人
Jialu.12 小时前
第7篇:舆情预警系统:三类规则引擎 + 飞书/钉钉 Webhook 通知
python·安全
渡我白衣12 小时前
HttpRequest与HttpResponse的实现
服务器·数据结构·c++·人工智能·tcp/ip·机器学习·caffe
甜到心里的蛋糕12 小时前
如何用企业微信实现让微信收到通知实时通知
服务器·python·微信小程序·fastapi
P.D.Wei12 小时前
[Leetcode 3524] 求出数组的X值I
python·学习
weixin1997010801614 小时前
《二手ERP对接闲鱼API:聚石塔强制入塔后的架构重构实录》(附Python源码)
python
小白快快跑哦14 小时前
python-字符串全解(六):正则表达式-转义与非转义
python·正则表达式·转义与非转义
IvanCodes20 小时前
Python 数据处理(十三):JSON、CSV 与数据序列化
开发语言·python