解决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
相关推荐
贝猫说python几秒前
阿里云部署qwen 大模型从0-1,第2步:阿里云平台创建ubuntu实例
python
峥嵘life几秒前
2026华为AI码道 CodeArts 使用分享:Windows端 + 服务器CLI 实战总结
android·大数据·开发语言·python
贝猫说python2 分钟前
阿里云部署qwen 大模型从0-1,第3步:阿里云服务器上部署大模型
python
少陽君6 分钟前
服务器服务检查报告
python
尘世中一位迷途小书童7 分钟前
我为什么在 Windows 上做了一个翻译软件:SnapLingo
前端·人工智能·机器学习
x秀x7 分钟前
sam3新手使用教程
开发语言·python
Java后端的Ai之路8 分钟前
大模型LLM评估完全指南
开发语言·人工智能·python·llm·评估
外收内放12 分钟前
Python学习记录25(基础知识终结篇)
python·学习
别动我齐刘海13 分钟前
ROS2 Jazzy + C++ 实战路线——基础学习1
c++·vscode·python·ubuntu·机器学习·自动驾驶·github
life码农20 分钟前
python框架Flask多语言配置示例
python·flask