解决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
相关推荐
nothing&nowhere3 小时前
用 Python 做问卷数据清洗:无效样本检测与处理实战
开发语言·python·数据清洗·数据处理·问卷星·问卷星脚本·刷问卷
花酒锄作田3 小时前
如何发布自己的 Python 库到 PyPI
python
researcher-Jiang3 小时前
Design Patterns——Template Method入门到情景实战
python·设计模式·模板方法模式
飞猪~7 小时前
LangChain python 版本 第一集
开发语言·python·langchain
2601_956319888 小时前
最新AI量化提效,先做可验证的小流程
人工智能·python
人工智能培训9 小时前
破解数据发展瓶颈 激活数字经济新动能
大数据·数据库·人工智能·深度学习·神经网络·机器学习·生成对抗网络
开飞机的舒克_9 小时前
FastAPI 实战入门:从路由、参数校验到依赖注入的后端开发指南
python·fastapi
大鱼>9 小时前
AI+货物追踪:智能快递柜追踪系统
人工智能·深度学习·算法·机器学习
霸道流氓气质10 小时前
Kiro 中反编译 JAR 包并分析字节码的流程指南
chrome·python·jar