解决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
相关推荐
安_5 小时前
如何构建和使用向量索引?HNSW 和 IVF 有什么区别?
python·ai
counting money6 小时前
Java IO流详解:从InputStream到文件操作实战
java·开发语言·python
坚持学习前端日记7 小时前
Python SQLAlchemy ORM 从0到1精通实战手册(基础到复杂高阶)
数据库·python·oracle
北斗落凡尘7 小时前
LangGraph 入门实战(11)--输出模式
后端·python·langchain
雪碧聊技术8 小时前
安装Python(保姆级教程)
python·版本更新·python下载
++==8 小时前
JSON和Python的 四种核心容器
python·json
空堂与归10 小时前
模型不准怎么调?机器学习核心理论与实战全流程
人工智能·机器学习
张龙68710 小时前
uv 全面指南:比 pip 快 100 倍的 Python 包管理器,从安装到团队落地
后端·python
@HNUSTer11 小时前
Python数据可视化科技图表绘制系列教程(八)
python·数据可视化·科技论文·专业制图·科研图表