解决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
相关推荐
2601_962077983 小时前
利用Python,四步掌握机器学习
python·机器学习·数据挖掘·数据分析·编程
axinawang3 小时前
requests--爬取网页内容
python
小雨笙笙4 小时前
机器学习:线性回归学习
学习·机器学习·线性回归
盼小辉丶4 小时前
PyTorch强化学习实战——融合人类示范数据的高效强化学习
人工智能·pytorch·python·深度学习·强化学习
聪明蛋子哟4 小时前
MCP协议深度落地:如何用Python/Java双语言实现统一的工具调用网关?
java·开发语言·python
天远Date Lab4 小时前
零信任架构实战:基于天远车信盟出险构建自动化汽车消费贷合规网关
人工智能·机器学习·计算机视觉·ocr
李妍.5 小时前
PyTorch GPU 版安装记录(RTX 5060 + Python 3.14)
人工智能·pytorch·python
90后的晨仔5 小时前
Python 基础语法完整汇总
python
广慈新医知5 小时前
当健康问题越来越复杂,AI更适合先帮我们“把问题问清楚”
人工智能·python
一晌小贪欢5 小时前
python-第27天:Python面向对象详解
开发语言·python·数据可视化·面向对象·python办公