【问题标题】:How do I fix this file not found error with PyTesseract?如何使用 PyTesseract 修复此文件未找到错误?
【发布时间】:2022-10-09 04:17:44
【问题描述】:

我正在尝试使用 PyTesseract 对这个页面进行 OCR,它似乎遇到了问题。当我运行以下代码时:

data = pytesseract.image_to_string(images[0], config=custom_config)

我收到此错误:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\User\\AppData\\Local\\Temp\\tess_kzpv28hg.txt'

我再次尝试 pip 安装 pytesseract,但这没有奏效。任何建议将不胜感激。谢谢!

【问题讨论】:

    标签: python opencv ocr tesseract python-tesseract


    【解决方案1】:

    当你使用 pytesseract 时,首先你必须确保你已经在你的系统中安装了 Tesseract-OCR。

    http://code.google.com/p/tesseract-ocr/ 安装 google Tesseract-OCR

    或者您可以下载 Tesseract-OCR 表格https://github.com/UB-Mannheim/tesseract/wiki

    然后将 pytesseract.pytesseract.tesseract_cmd = 'C:Program Files (x86)Tesseract-OCR esseract.exe' 添加到您的脚本中。

    【讨论】:

      猜你喜欢
      • 2020-07-10
      • 1970-01-01
      • 2022-01-05
      • 2018-07-21
      • 2014-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多