解决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
相关推荐
言乐66 分钟前
Python概括后端原理
开发语言·python·django·virtualenv·pygame
Y38153266214 分钟前
搜索 API 响应模块:featured_snippet、PAA 与 knowledge_graph 怎么用
python·搜索引擎
10年前端老司机1 小时前
实战分享:基于 PyMuPDF+Qwen-VL 实现图文兼容的 PDF RAG 方案
人工智能·python·agent
YOLO数据集集合1 小时前
红外缺陷检测数据集 | 红外检测 缺陷识别 裂缝检测 渗漏检测 目标检测9145期
人工智能·目标检测·机器学习·计算机视觉·目标跟踪·智慧城市
2601_962885721 小时前
如何用 Python 回测定投策略(定期定额 DCA)?(和一次性买入对比)
开发语言·人工智能·python
蜗牛互联网1 小时前
Python接入Gemini 3.8 Flash实现票据视觉抽取与规则校验
java·javascript·网络·人工智能·python
小小张说故事1 小时前
Python 虚拟环境到底怎么选?venv/conda/pipenv/poetry 一张对比表 + 9 个踩坑
python
在世修行1 小时前
干货:配置持久化与引擎状态的可视化
python·可视化·持久化
小鱼~~2 小时前
Recall@K、Precision@K、MRR、nDCG@K简介
人工智能·算法·机器学习
在所不辞兄2 小时前
【零基础学智能仿真-38】从规则矩形到带孔薄板:Gmsh 网格与 FEniCSx 联合求解
人工智能·深度学习·算法·机器学习·工程仿真