Pytesseract TesseractError: (3221225794, '') - PullRequest
1 голос
/ 02 мая 2020

У меня есть этот скрипт

from sys import argv
import pytesseract as pt
from PIL import Image
from PIL import ImageFilter

pt.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'

data = Image.open(argv[1])


print(pt.image_to_string(data, lang='spa'))

, и я использую команду

py ocr.py jSsatrFOyto2M2RdotUeb30L33OJAf.jpg

Я получаю полную ошибку

Traceback (most recent call last):
  File "ocr.py", line 11, in <module>
    print(pt.image_to_string(data, lang='spa'))
  File "C:\Users\andres\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pytesseract\pytesseract.py", line 343, in image_to_string
    return {
  File "C:\Users\andres\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pytesseract\pytesseract.py", line 346, in <lambda>
    Output.STRING: lambda: run_and_get_output(*args),
  File "C:\Users\andres\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pytesseract\pytesseract.py", line 257, in run_and_get_output
    run_tesseract(**kwargs)
  File "C:\Users\andres\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pytesseract\pytesseract.py", line 233, in run_tesseract
    raise TesseractError(proc.returncode, get_errors(error_string))
pytesseract.pytesseract.TesseractError: (3221225794, '')

Я использую python 3.8 и tesseract v5.0.0-alpha.20200223

...