首页 > 解决方案 > tkinter 回调中的异常:失败,退出代码 3221225781

问题描述

通过将 poppler 添加到我的 PATH 环境变量中,我以某种方式修复了错误代码 127 的先前错误,但是现在我受到了这个新错误的欢迎。有谁知道这可能意味着什么以及如何解决它。我正在尝试运行我在 MAC 上创建的工具,以使用 textract 将 PDF 读取为文本。它在 MacOS 上运行得很好但是它似乎在 Windows 上运行有问题。任何帮助将非常感激。

提前致谢 :)

Exception in Tkinter callback
Traceback (most recent call last):
  File "tkinter\__init__.py", line 1883, in __call__
  File "\\Mac\Home\PycharmProjects\WickeyEinkaufAutomation\EinkaufRGWindows.py", line 40, in InkoopRekeningen
    text = textract.process(str(importfolder) + str(i))
  File "site-packages\textract\parsers\__init__.py", line 77, in process
  File "site-packages\textract\parsers\utils.py", line 46, in process
  File "site-packages\textract\parsers\pdf_parser.py", line 28, in extract
  File "site-packages\textract\parsers\pdf_parser.py", line 20, in extract
  File "site-packages\textract\parsers\pdf_parser.py", line 43, in extract_pdftotext
  File "site-packages\textract\parsers\utils.py", line 100, in run
textract.exceptions.ShellError: The command `pdftotext //Mac/Home/Desktop/WET/Rekeningen/Lekkerkerker_ - 20803471.pdf -` failed with exit code 3221225781
------------- stdout -------------
b''------------- stderr -------------
b''

标签: pythontkinterpdftotextpoppler

解决方案


MacOS 和 Windows 上的路径使用不同的斜杠,因此 MacOS 程序也需要更改才能在 Windows 上运行。Mac 使用 / 斜杠,而 Windows - .


推荐阅读