解决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
相关推荐
unicrom_深圳市由你创科技15 分钟前
基于Spring AI框架的RAG应用
人工智能·spring·机器学习
如竟没有火炬29 分钟前
最大矩阵——单调栈
数据结构·python·线性代数·算法·leetcode·矩阵
阳区欠38 分钟前
【LangChain】LLM基础介绍
开发语言·python·langchain
Cosolar39 分钟前
保姆级 CrewAI 教程:从零构建多智能体协作系统
人工智能·python·架构
GDAL1 小时前
使用 uv 管理 Python 版本
python·uv·版本
真实的菜1 小时前
Redis 从入门到精通(十二):典型业务场景实战 —— 排行榜、限流器、秒杀系统、Session 共享
数据库·redis·python
cup111 小时前
[开源] Meta Assistant / 告别命令行,我为一堆 Python 脚本做了一个 Windows 任务栏的“家”
windows·python·工具·nuitka·脚本运行
Sirius Wu2 小时前
意图&实体ToolCall_Prompt调优
人工智能·机器学习·语言模型·prompt·aigc
小小编程路2 小时前
Python 还有容器类型互转、进制转换、字符编码转换
开发语言·windows·python