解决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
相关推荐
点云-激光雷达-Slam-三维牙齿17 小时前
速度起飞 笔记本电脑6G显卡llama运行Qwen3.6 35BA3B MTP 大模型
人工智能·python·电脑·llama
言乐618 小时前
Python游戏水平测试辅助系统
开发语言·python·游戏·django·pygame
从零开始学习人工智能1 天前
【踩坑实录】WSL2 解决 onnxruntime\-gpu ImportError: libcudart\.so\.13 无 CUDA13 运行库问题
python
卷无止境1 天前
在 awesome-fastapi 里,哪些库值得一看?
后端·python
ltl1 天前
LLM 训练全景:Pre-train、SFT、RLHF、DPO 与蒸馏
机器学习
zhanghaha13141 天前
Python进阶教程:6_JSON 数据解析 —— 新手完全指南
开发语言·python·json
Python私教1 天前
API 输出模型怎么设计:从 model_dump() 到显式展示层
python·fastapi
Python私教1 天前
本地 AI 工具服务该绑定 127.0.0.1 还是 0.0.0.0?
python·fastapi
知识分享小能手1 天前
线性代数学习教程,从入门到精通,向量组的线性相关性 — 完整知识点梳理(7)
学习·线性代数·机器学习
卷无止境1 天前
FastAPI 的Admin面板生态
后端·python