OCRmyPDF 找不到 Leptonica 库

ter*_*rry 5 python ocr tesseract python-tesseract

我在 conda 环境中安装了 OCRmyPDF 包,并一直与 pytesseract 一起使用。当我运行命令“ocrmypdf --help”时,我收到以下错误:

[WinError 2] The system cannot find the file specified
Traceback (most recent call last):
  File "c:\users\{user}\anaconda3\envs\tesseract\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\{user}\anaconda3\envs\tesseract\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\{user}\Anaconda3\envs\tesseract\Scripts\ocrmypdf.exe\__main__.py", line 4, in <module>
  File "c:\users\{user}\anaconda3\envs\tesseract\lib\site-packages\ocrmypdf\__init__.py", line 10, in <module>
    from ocrmypdf import helpers, hocrtransform, leptonica, pdfa, pdfinfo
  File "c:\users\{user}\anaconda3\envs\tesseract\lib\site-packages\ocrmypdf\leptonica.py", line 44, in <module>
    raise MissingDependencyError(
ocrmypdf.exceptions.MissingDependencyError:
        ---------------------------------------------------------------------
        This error normally occurs when ocrmypdf can't find the Leptonica
        library, which is usually installed with Tesseract OCR. It could be that
        Tesseract is not installed properly, we can't find the installation
        on your system PATH environment variable.

        The library we are looking for is usually called:
            liblept-5.dll   (Windows)
            liblept*.dylib  (macOS)
            liblept*.so     (Linux/BSD)

        Please review our installation procedures to find a solution:
            https://ocrmypdf.readthedocs.io/en/latest/installation.html
        ---------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)

在被问到之前,是的,我确实安装了 tesseract,因为我已经成功使用了 pytesseract。我怀疑这个问题是因为我使用 conda 安装 Tesseract,它安装在我的环境中,而不是从源代码下载并直接在 Windows 中编译。在 pytesseract 中,我能够将 Tesseract 可执行文件的位置设置为 pytesseract 用于调用“tesseract”的变量,方法是将

pytesseract.pytesseract.tesseract_cmd = r'C:\Users\{user}\Anaconda3\envs\tesseract\Library\bin\tesseract.exe'
Run Code Online (Sandbox Code Playgroud)

在脚本中。我直接搜索了 OCRmyPDF 文档和源代码,看看是否可以找到一个变量或命令行参数,我可以类似地为其分配位置,但没有取得任何成功。是否有类似的解决方法,或者我是否必须直接在 Windows 中编译 Tesseract 才能使 OCRmyPDF 运行?

Also, I saw this thread that says I can add the conda environment to my system's PATH, but I am not sure if that would then allow OCRmyPDF to access the Tesseract and Leptonica packages and solve the problem or if that would open other issues or honestly what would happen as I have exceedingly limited knowledge of Windows from a programming standpoint.