簡體   English   中英

在 Python 中的 Visual Stdio 代碼中導入 ocrmypdf

[英]Import ocrmypdf in Visual Stdio Code in Python

我想導入ocrmypdf

我已經使用pip install --upgrade --user ocrmypdf安裝了軟件包

但是當我嘗試在 VSC 中導入時:

import ocrmypdf

它捕獲了錯誤:

[WinError 2] The system cannot find the file specified
[WinError 2] The system cannot find the file specified
---------------------------------------------------------------------------
MissingDependencyError                    Traceback (most recent call last)
<ipython-input-9-a81f3474d7ad> in <module>
----> 1 import ocrmypdf

~\AppData\Roaming\Python\Python38\site-packages\ocrmypdf\__init__.py in <module>
      8 from pluggy import HookimplMarker as _HookimplMarker
      9 
---> 10 from ocrmypdf import helpers, hocrtransform, leptonica, pdfa, pdfinfo
     11 from ocrmypdf._concurrent import Executor
     12 from ocrmypdf._jobcontext import PageContext, PdfContext

~\AppData\Roaming\Python\Python38\site-packages\ocrmypdf\leptonica.py in <module>
     42 _libpath = find_library(libname)
     43 if not _libpath:
---> 44     raise MissingDependencyError(
     45         """
     46         ---------------------------------------------------------------------

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
        ---------------------------------------------------------------------
        

錯誤日志指出缺少某些依賴項,這意味着缺少 ocrmypdf 正在使用的某些模塊。 最有可能的是,它需要 teseract OCR。 嘗試安裝它,它可能會起作用。 甚至模塊的文檔也指出,模​​塊需要 tesseract 才能正常工作。

ocrmypdf 的要求

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM