TExtract:失败,退出代码127//Windows 10//pdftotext

问题描述

当我试图运行我的(在使用pyinstaller部署之后)程序来读取和转换PDF文件并将其输入到Google工作表中时。我得到了下图中显示的错误。然而,我似乎想不出问题是什么:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:Users	rpfinanceAppDataLocalProgramsPythonPython38-32libsite-packages	extractparsersutils.py", line 82, in run
    pipe = subprocess.Popen(
  File "C:Users	rpfinanceAppDataLocalProgramsPythonPython38-32libsubprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:Users	rpfinanceAppDataLocalProgramsPythonPython38-32libsubprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:Users	rpfinanceAppDataLocalProgramsPythonPython38-32lib	kinter\__init__.py", line 1883, in __call__
    return self.func(*args)
  File "EinkaufRGWindows.py", line 40, in InkoopRekeningen
    text = textract.process(str(importfolder) + str(i))
  File "C:Users	rpfinanceAppDataLocalProgramsPythonPython38-32libsite-packages	extractparsers\__init__.py", line 77, in process
    return parser.process(filename, encoding, **kwargs)
  File "C:Users	rpfinanceAppDataLocalProgramsPythonPython38-32libsite-packages	extractparsersutils.py", line 46, in process
    byte_string = self.extract(filename, **kwargs)
  File "C:Users	rpfinanceAppDataLocalProgramsPythonPython38-32libsite-packages	extractparserspdf_parser.py", line 28, in extract
    raise ex
  File "C:Users	rpfinanceAppDataLocalProgramsPythonPython38-32libsite-packages	extractparserspdf_parser.py", line 20, in extract
    return self.extract_pdftotext(filename, **kwargs)
  File "C:Users	rpfinanceAppDataLocalProgramsPythonPython38-32libsite-packages	extractparserspdf_parser.py", line 43, in extract_pdftotext
    stdout, _ = self.run(args)
  File "C:Users	rpfinanceAppDataLocalProgramsPythonPython38-32libsite-packages	extractparsersutils.py", line 90, in run
    raise exceptions.ShellError(
textract.exceptions.ShellError: The command `pdftotext //Mac/Home/Desktop/Wickey Einkauf Test/Rekeningen/Lekkerkerker_ - 20803471.pdf -` failed with exit code 127
------------- stdout -------------
------------- stderr -------------


解决方案

您需要使用pip安装pdftotext。 若要安装它,您需要安装Microsoft Visual C++14或更高版本。

相关文章