解决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
相关推荐
八月瓜科技10 分钟前
专精特新企业如何搭建专利资产中台?三步落地法
大数据·数据库·人工智能·科技·深度学习·机器学习·oracle
timeDifference₇23 分钟前
Python Vibe Coding实操实验报告
开发语言·jvm·python
geovindu1 小时前
python:DecisionTree
开发语言·后端·python·算法
怒放的生命19912 小时前
代码知识库 RAG 问答系统 —— 从 0 到 1 实现教程
python·状态模式·fastapi·全栈开发·ai agent应用开发
geovindu3 小时前
python: Decision Tree Regressor
开发语言·后端·python·算法·决策树
fengkai45454 小时前
Python运维
运维·python·监控·psutil·ipy
Fancy.7614 小时前
:Python条件与循环语句学习总结
python
Wellijohn5 小时前
Python 容器选型实测:list.insert(0) 慢 925 倍,in 慢 6000 倍
python
新*5 小时前
标题全变成一级?靠编号规律找回章节边界
python·正则表达式·pdf解析·文本处理