解决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
相关推荐
我不是QI5 分钟前
周志华《机器学习---西瓜书》 一
人工智能·python·机器学习·ai
今天没ID6 分钟前
Python 编程实战:从基础语法到算法实现 (1)
python
H***997624 分钟前
月之暗面公开强化学习训练加速方法:训练速度暴涨97%,长尾延迟狂降93%
人工智能·深度学习·机器学习
二川bro30 分钟前
Python在AI领域应用全景:2025趋势与案例
开发语言·人工智能·python
长桥夜波37 分钟前
机器学习日报20
人工智能·机器学习
棒棒的皮皮1 小时前
【Python】Open3d用于3D测高项目
python·3d·open3d
CodeLongBear1 小时前
Python数据分析: 数据可视化入门:Matplotlib基础操作与多坐标系实战
python·信息可视化·数据分析
李晨卓1 小时前
python学习之不同储存方式的操作方法
python·代码规范
站大爷IP2 小时前
实战:爬取某联招聘职位需求并生成词云——从零开始的完整指南
python
deephub2 小时前
从零开始:用Python和Gemini 3四步搭建你自己的AI Agent
人工智能·python·大语言模型·agent