我正在使用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
如何消除此错误?