我正在使用pytesseract来包含英语和希伯来语的图像 . 在其中一些它工作正常但在其他人发生以下错误:

回溯(最近一次调用最后一次):文件“C:\ Users \ User \ Desktop \ ocr.py”,第47行,文本= pytesseract.image_to_string(Image.open(filename),lang =“heb eng”)文件“C:\ Python27 \ lib \ site-packages \ pytesseract \ pytesseract.py”,第286行,在image_to_string中返回run_and_get_output(image,'txt',lang,config,nice)文件“C:\ Python27 \ lib \ site- package \ pytesseract \ pytesseract.py“,第194行,在run_and_get_output中运行run_tesseract(** kwargs)文件”C:\ Python27 \ lib \ site-packages \ pytesseract \ pytesseract.py“,第170行,在run_tesseract中引发TesseractError(status_code, get_errors(error_string))pytesseract.pytesseract.TesseractError:( - 1073741819,u'')

我已经安装了heb.traineddata,所以我不确定可能是什么问题 . 在那些产生此错误的图像上,使用“eng”只会导致代码失败,但最终会返回错误的结果,显然忽略了希伯来文本 .

为什么pytesseract会对某些文件起作用而其他文件却不起作用?

谢谢