My code is straight forward and is the following:
import pytesseract
from PIL import Image
img = Image.open('C:/temp/foo.jpg')
img.load()
i = pytesseract.image_to_string(img)
and the error response I get back is:
Traceback (most recent call last):
File "img.py", line 6, in <module>
i = pytesseract.image_to_string(img)
File "build\bdist.win32\egg\pytesseract\pytesseract.py", line 161, in image_to
_string
File "build\bdist.win32\egg\pytesseract\pytesseract.py", line 94, in run_tesse
ract
File "C:\Users\%USER%\AppData\Local\Continuum\Anaconda\lib\subprocess.py",
line 710, in __init__
errread, errwrite)
File "C:\Users\%USER%\AppData\Local\Continuum\Anaconda\lib\subprocess.py",
line 958, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
Any guidance would be fantastic.
Adding tesseract to my path variable helped:
C:\Program Files (x86)\Tesseract-OCR
But the code now crashes when trying to run the pytesseract piece.