解决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月的第三方库

相关推荐
阿kun要赚马内几秒前
Python面向对象编程:封装性
开发语言·python
郝学胜-神的一滴5 分钟前
巧解括号序列分解问题:栈思想的轻量实现
开发语言·数据结构·c++·算法·面试
代码改善世界14 分钟前
【C++初阶】string类(一):从基础到实战
开发语言·c++
计算机安禾14 分钟前
【数据结构与算法】第15篇:队列(二):链式队列的实现与应用
c语言·开发语言·数据结构·c++·学习·算法·visual studio
Leventure_轩先生15 分钟前
[RL]强化学习指导搭建IC2E核反应堆
开发语言·php
￰meteor21 分钟前
23种设计模式 -【工厂方法】
后端
zzginfo28 分钟前
var、let、const、无申明 四种变量在赋值前,使用的情况
开发语言·前端·javascript
csdn_aspnet1 小时前
C++ 求n边凸多边形的对角线数量(Find number of diagonals in n sided convex polygon)
开发语言·c++·算法