解决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
相关推荐
代码山河2 小时前
Python就业方向全解析:后端、爬虫、数据分析、AI你选哪个?
python·学习·架构·教程·面向对象·项目
在世修行2 小时前
智学文枢:题目流水线
python·多线程·状态机·pyside
梯度下降者3 小时前
零基础入门Python 爬虫
爬虫·python·数据分析·入门指南·webcrawler
小奶包他干奶奶4 小时前
AI学习——1、机器学习概念
人工智能·机器学习
“AI国潮设计-小江”5 小时前
【AIGC实战】Python+Stable Diffusion打造“英歌舞财神”IP,解锁“马到成功”等爆款情绪营销文案设计
开发语言·人工智能·python·prompt·aigc
benchmark_cc6 小时前
用 Python 拉 A 股全市场实时快照:Notebook 请求、结果校验与易错点
python·数据分析·pandas·量化交易·股票数据·quantdash
伞伞悦读6 小时前
【第70期】Adam二阶矩不是方差:偏差校正、动量与AdamW完整实验
python
外收内放6 小时前
Python基础语法练习题(73)
java·前端·python
锋行天下6 小时前
Langgraph HITL 中断运行,用户输入后输出打字效果
人工智能·python
时早玖沐7 小时前
给 AstrBot 写一个天气推送插件:12 次提交、6 个坑
python·开源·ai编程