解决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
相关推荐
卷无止境3 分钟前
在 awesome-fastapi 里,哪些库值得一看?
后端·python
ltl8 分钟前
LLM 训练全景:Pre-train、SFT、RLHF、DPO 与蒸馏
机器学习
zhanghaha131427 分钟前
Python进阶教程:6_JSON 数据解析 —— 新手完全指南
开发语言·python·json
Python私教39 分钟前
API 输出模型怎么设计:从 model_dump() 到显式展示层
python·fastapi
Python私教1 小时前
本地 AI 工具服务该绑定 127.0.0.1 还是 0.0.0.0?
python·fastapi
知识分享小能手1 小时前
线性代数学习教程,从入门到精通,向量组的线性相关性 — 完整知识点梳理(7)
学习·线性代数·机器学习
卷无止境1 小时前
FastAPI 的Admin面板生态
后端·python
ctlover2 小时前
Streamlit 框架
python
ι:2 小时前
MATLAB 与 Python 搭建无人机地面站:优势、劣势与选型逻辑
python·matlab·无人机
船厂电气自动化ai大模型2 小时前
AI大模型与数学 第32课 函数凹凸性与二阶导数:拐点求解、凹凸区间计算(10道二阶导数计算题)
数据结构·人工智能·python·深度学习·算法