解决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
相关推荐
小猴子爱上树4 分钟前
Temu批量视频翻译Python实现方案
开发语言·python·音视频
lisw058 分钟前
计算免疫学的前沿领域
人工智能·机器学习
X1A0RAN17 分钟前
Python 并发请求性能优化实战
python·性能优化·并发编程
陈同学xxx23 分钟前
Hermes Agent 接入飞书,在手机上随时聊天
linux·python·飞书
卷无止境28 分钟前
Python 中基于 Qt 的 GUI 库授权方式全解析
后端·python
卷无止境42 分钟前
Guardrails.ai:为大语言模型加一道"安全阀"
后端·python
AI科技星2 小时前
基于全域数学公理体系求解三元约束极值题【乖乖数学】
人工智能·算法·机器学习·密码学·拓扑学·乖乖数学·全域数学
汤姆小白5 小时前
01-环境搭建与项目导览
人工智能·python·机器学习·numpy
向日的葵00611 小时前
langchain的Tools教程(三)
python·langchain·tools
言乐612 小时前
Python实现可运行解密游戏游戏框架
python·游戏·小程序·游戏程序·关卡设计