解决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
相关推荐
weixin_5134499626 分钟前
walk_these_ways项目学习记录第八篇(通过行为多样性 (MoB) 实现地形泛化)--策略网络
开发语言·人工智能·python·学习
飞Link31 分钟前
逆向兼容的桥梁:3to2 自动化降级工具实现全解析
运维·开发语言·python·自动化
zhangshuang-peta37 分钟前
通过 MCP 控制平面引入技能
人工智能·机器学习·ai agent·mcp·peta
曾阿伦39 分钟前
Python3 文件 (夹) 操作备忘录
开发语言·python
架构师老Y1 小时前
006、异步编程与并发模型:asyncio与高性能后端
python
清水白石0081 小时前
《解锁 Python 潜能:从核心语法到 AI 服务层架构的工业级进阶与实战》
人工智能·python·架构
kcuwu.1 小时前
Python数据分析三剑客导论:NumPy、Pandas、Matplotlib 从入门到入门
python·数据分析·numpy
大连好光景1 小时前
学会评估模型的拟合状态和泛化能力
人工智能·机器学习
weixin_513449961 小时前
walk_these_ways项目学习记录第七篇(通过行为多样性 (MoB) 实现地形泛化)--核心环境下
人工智能·python·学习
南 阳1 小时前
Python从入门到精通day64
开发语言·python