pytesseract OCR错误

时间:2015-11-27 11:15:07

标签: python python-2.7 tesseract python-tesseract

我正在使用pytesseract从图片中获取文字。但是我收到了这个错误。

这是我的源文件。 dir包含图片

import Image
from pytesseract import image_to_string
print image_to_string(Image.open('download.png'))
#download.png is in same dir as the source file is

我收到此错误

Traceback (most recent call last):

File "ocr.py", line 3, in <module>
    print(image_to_string(Image.open('download.png')))

File "/home/suraj/.local/lib/python2.7/site-packages/pytesseract/pytesseract.py", line 161, in image_to_string
    config=config)

  File "/home/suraj/.local/lib/python2.7/site-packages/pytesseract/pytesseract.py", line 94, in run_tesseract
    stderr=subprocess.PIPE)

  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)

  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

如何删除此错误?

0 个答案:

没有答案