当前位置: 首页> 教育> 大学 > 解决ImportError: DLL load failed while importing _rust: 找不到指定的程序

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

时间:2025/7/26 21:02:06来源:https://blog.csdn.net/qq_28821897/article/details/141156348 浏览次数:0次

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

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

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: