解决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
相关推荐
MageGojo3 分钟前
10 种主题随机诗词:一个 API 解决小程序的诗词内容源
python·小程序·古诗词·api 接入
cooldream200912 分钟前
使用 uv 管理 Python 虚拟环境:现代 Python 开发的高效实践
python·uv·mcp
测试_AI_一辰14 分钟前
AI测试工程师的统计学课:如何构建“反脆弱“的评估体系
人工智能·深度学习·机器学习·ai·ai编程
zhangfeng113320 分钟前
国家超算中心 系统自带模型 和pytorch 和cuda版本
人工智能·pytorch·python
m0_7381207227 分钟前
渗透测试基础——黑盒测试下的Web漏洞挖掘与利用解析(二)
服务器·前端·python·网络协议·安全·网络安全
玫幽倩35 分钟前
2025FIC取证决赛wp(手机取证)
python·智能手机·手机·电子取证·计算机取证·手机取证·fic
多彩电脑36 分钟前
Kivy如何自定义事件
开发语言·python
java_cj37 分钟前
LangChain初入门 - 简化LLM开发难度的利器
开发语言·python·langchain
@小阿宝38 分钟前
PPF(Point-Pair Feature,点对特征)
人工智能·机器学习
sleven fung41 分钟前
llama-cpp-python 本地部署入门
开发语言·python·算法·llama