文本 - windows10 - shell 错误 - 失败,退出代码为 127

问题描述 投票:0回答:0

以下代码适用于 txt 文件,但不适用于 pdf 文件。

import textract
text = textract.process(r'C:\Users\Python_files\accounts.txt')

但是,我似乎无法弄清楚以下代码片段中的问题所在:

import textract
path = r'C:\Users\Python_files\accounts.pdf'
text = textract.process(path)

以上代码导致以下错误:

ShellError: The command `pdftotext C:\Users\Python_files\accounts.pdf -` failed with exit code 127
------------- stdout -------------
------------- stderr -------------
python pypdf file-not-found pdfminer pdftotext
© www.soinside.com 2019 - 2024. All rights reserved.