解决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
相关推荐
西西弗Sisyphus1 分钟前
Python 中__pycache__文件夹
python
qingcyb7 分钟前
重复 id 对应的多个对象
开发语言·python
mingshili7 分钟前
[python] asyncio常规操作记录
python·async
chushiyunen9 分钟前
python edge-tts实现tts文本转语音、音频
数据库·python·音视频
嫂子的姐夫16 分钟前
040-spiderbuf第C8题
javascript·爬虫·python·js逆向·逆向
江上清风山间明月19 分钟前
python将dtso文件转换成dtbo文件
python·dts·dtso
天下无贼!24 分钟前
【Python】2026版——FastAPI 框架快速搭建后端服务
开发语言·前端·后端·python·aigc·fastapi
2501_9454235427 分钟前
游戏与图形界面(GUI)
jvm·数据库·python
zm-v-1593043398637 分钟前
Python 气象数据处理从入门到精通:机器学习订正 + 深度学习预测完整教程
python·深度学习·机器学习
1941s1 小时前
Google Agent Development Kit (ADK) 指南 第四章:Agent 开发与编排
人工智能·python·langchain·agent·adk