解决ImportError: DLL load failed while importing _rust: 找不到指定的程序

解决ImportError: 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的版本,查看版本的方法如下

复制代码
import cryptography
print(cryptography.__version__)

解决办法

安装低版本的 cryptography

复制代码
pip install cryptography==41.0.2

这里报错的内容是解决问题的关键,它提示我说我的cryptography的版本是错误的,我的cryptography版本应该与pyopenssl的版本相对应,最少应为41.0.5版本。而之前报错的版本为42版本的,所以这里保险起见,我下载了41.0.5版本的cryptography。

pip install cryptography==41.0.5

关于python提取pdf 如果pdf被限制只能查看阅读,但是不能正常提取pdf文字的问题

复制代码
f = open(read_path, 'rb')
# 来创建一个pdf文档分析器
parser = PDFParser(f)
# 创建一个PDF文档对象存储文档结构
document = PDFDocument(parser)

if(document.is_extractable!=True):
    print("该PDF可能受限")

python版本问题需要对应 3.9 对应202312月的第三方库

相关推荐
郝亚军14 小时前
FE1.1S-BQFN24BT可以指定IP端口吗?
开发语言·php
阿里嘎多学长14 小时前
2026-08-04 GitHub 热点项目精选
开发语言·程序员·github·代码托管
SelectDB15 小时前
金城银行基于 Apache Doris 构建实时数据平台:T+1 到分钟级的金融级实践
后端
Csvn15 小时前
📊 SQL 入门 Day 13:窗口函数进阶
后端·sql
晴天1615 小时前
Rust 快速入门 (从 JavaScript 开发者视角)-Day09
开发语言·javascript·rust
卷无止境15 小时前
拯救乱码方块:pandas 绘图中文字体的一揽子解决方案
后端·python
梦醒沉醉15 小时前
13、Rust程序设计语言——认识Cargo和Crates.io
rust
SelectDB15 小时前
Apache Doris 4.1:面向 AI & Search 的统一数据底座怎么选?向量检索 + 全文搜索 + 100MB JSON 完整能力拆解
后端
lichenyang45315 小时前
从图片生成任务到用户隔离:AIGC Creative Studio 后端与 PostgreSQL 建模实践
前端·后端
步行cgn15 小时前
carList.forEach(System.out::println)
java·开发语言·mybatis