解决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
相关推荐
C^h2 小时前
python函数学习
人工智能·python·机器学习
Fanta丶2 小时前
4.Python set()集合、dict(字典、映射)、 数据容器的通用功能
python
决战灬2 小时前
langgraph之interrupt(理论篇)
人工智能·python·agent
兜客互动2 小时前
2026年AI关键词拓展挖掘软件,高效助力内容创作精准获流
人工智能·python
weixin_538601972 小时前
智能体测开Day30pytest测试框架
python
MC皮蛋侠客2 小时前
uv 系列(七):CI/CD、Docker 与私有索引——生产级交付
python·ci/cd·docker·uv
邪神与厨二病3 小时前
牛客周赛 Round 153
python·算法
yaoxin5211233 小时前
470. Java 反射 - Member 接口与 AccessFlag
java·开发语言·python
groundhappy3 小时前
idalib安装和codex ida-mcp配置
linux·开发语言·python
培之4 小时前
RTX 5090 安装 pytorch3d
人工智能·pytorch·python