解决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
相关推荐
lntu_ling4 分钟前
Python-基于Haversine公式计算两点距离
开发语言·python·gis算法
橙露5 小时前
数据特征工程:缺失值、异常值、标准化一站式解决方案
人工智能·机器学习
哈里谢顿6 小时前
Django 应用 OOM(Out of Memory)故障的定位思路和排查方法
python·django
甄心爱学习7 小时前
【python】获取所有长度为 k 的二进制字符串
python·算法
tuotali20267 小时前
氢气压缩机技术规范亲测案例分享
人工智能·python
嫂子的姐夫8 小时前
030-扣代码:湖北图书馆登录
爬虫·python·逆向
a1117768 小时前
EasyVtuber(或其衍生/增强版本)的虚拟主播(Vtuber)面部动画生成与直播解决方案
python·虚拟主播
lintax8 小时前
计算pi值-积分法
python·算法·计算π·积分法
小凯123458 小时前
pytest框架-详解(学习pytest框架这一篇就够了)
python·学习·pytest
逻极8 小时前
pytest 入门指南:Python 测试框架从零到一(2025 实战版)
开发语言·python·pytest