解决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
相关推荐
用户83562907805111 小时前
无需 Office:Python 批量转换 PPT 为图片
后端·python
markfeng813 小时前
Python+Django+H5+MySQL项目搭建
python·django
GinoWi14 小时前
Chapter 2 - Python中的变量和简单的数据类型
python
JordanHaidee14 小时前
Python 中 `if x:` 到底在判断什么?
后端·python
OpenBayes贝式计算14 小时前
解决视频模型痛点,TurboDiffusion 高效视频扩散生成系统;Google Streetview 涵盖多个国家的街景图像数据集
人工智能·深度学习·机器学习
ServBay14 小时前
10分钟彻底终结冗长代码,Python f-string 让你重获编程自由
后端·python
OpenBayes贝式计算14 小时前
OCR教程汇总丨DeepSeek/百度飞桨/华中科大等开源创新技术,实现OCR高精度、本地化部署
人工智能·深度学习·机器学习
闲云一鹤15 小时前
Python 入门(二)- 使用 FastAPI 快速生成后端 API 接口
python·fastapi
Rockbean16 小时前
用40行代码搭建自己的无服务器OCR
服务器·python·deepseek