解决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
相关推荐
岁月宁静6 分钟前
如何设计支持 Skills 的 Agent?一套可扩展的四层架构
python·agent
岁月宁静19 分钟前
CrewAI 快速上手:10 分钟搭建你的第一个 Agent 团队
python·agent
曲径海盗40 分钟前
【Python 学习第 40 天】for 循环
python·学习笔记·编程入门
专注仿真1 小时前
知识问答大模型-rag算法详解
人工智能·python·控制算法
染指11101 小时前
158.Agent-LangGraph-子图(共享状态和不共享状态模式)
开发语言·人工智能·python·ui·agent·agents
汤姆宝库2 小时前
安全深拆:越狱物理、注入攻击与纵深防御
人工智能·安全·机器学习·ai
云和数据.ChenGuang3 小时前
Python 常见特殊方法详解:__new__、__init__、__del__、__str__、__repr__ 与 __getattribute__
开发语言·人工智能·python·1024程序员节
xyouyuweizhu3 小时前
字节流与字符流:Java IO 的两条主线该怎么选
java·开发语言·python