【问题标题】:PyTesseract - installation issuePyTesseract - 安装问题
【发布时间】:2020-02-27 23:37:10
【问题描述】:

在尝试运行我的脚本时,我遇到了 Pytesseract 问题。 我已经通过 pip 安装并安装了 exe 文件。 但是,当尝试运行以下简化代码时:

import pytesseract

pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract.exe'
text = pytesseract.image_to_string(rotated_image)

我经常被以下错误代码困扰:

OSError: [WinError 740] The requested operation requires elevation

我拥有笔记本电脑的管理员权限,但不是主帐户。 任何帮助将不胜感激。

【问题讨论】:

    标签: python-tesseract


    【解决方案1】:

    以管理员身份运行终端或 IDE。

    那么关于OSError: [WinError 740] The requested operation requires elevation的错误应该消失了。

    【讨论】:

      【解决方案2】:

      我可以直接使用此代码来使用tesseract,而无需设置路径。

      import pytesseract
      
      result = pytesseract.image_to_string("./important/aaa.jpg")
      print(result)
      

      因为我将tesseract 文件夹添加到系统路径中。

      您已在您的C:\Program Files (x86) 中安装了tesseract。没有管理员权限,此目录无法轻松访问。

      所以现在,如果你不想以管理员身份运行这段代码,你可以直接

      tesseract的文件夹添加到你的系统PATH中。

      你收到了吗?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-05-31
        • 2016-12-13
        • 1970-01-01
        • 2012-05-07
        • 1970-01-01
        相关资源
        最近更新 更多