解决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
相关推荐
whcyhhh6 小时前
CTF‑MISC 隐写术完整学习笔记|图片隐写全题型 + 工具 + 实战例题
python·网络安全·ctf·misc·信息隐藏
码视野6 小时前
多宠 RFID 颈圈识别与湿粮半导体制冷保鲜分餐喂食器解决方案(软硬件一体化)
大数据·人工智能·python
未若君雅裁6 小时前
让模型按契约返回数据,LangChain 结构化输出实战
python·langchain
学习中.........7 小时前
Transformer 训练资源估算:以 CS336 GPT-2 XL 配置为例
人工智能·python·算法·机器学习·自然语言处理
小陈的进阶之路13 小时前
Claude Code辅助测试:导入篇skills
python·自动化
sel_914 小时前
【强化学习】Hands-on Modern RL项目实践|OPD 算法完整解析
人工智能·深度学习·算法·机器学习·语言模型
whcyhhh14 小时前
头歌实践教学平台:大数据存储2023(六)
大数据·数据库·python
for_ever_love__15 小时前
python基础语法学习: 闭包
开发语言·python·学习·闭包
ly768915 小时前
Python 全面入门:从核心语法到工程实践
开发语言·python