Reputation: 39
Can you please help me to install tesseract and pyteeser for Python2.7 on Windows 7?
A download link and detailed steps how to install these packages would be preferred.
I tried using easy_install
but it threw an error
I installed pyteeser, also changed import Image
to from PIL import image
in pyteeser.py file.
But now i am getting this error
File "C:\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 699, in runfile execfile(filename, namespace)
File "C:\Anaconda2\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 74, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc)
File "C:/Users/Duggentious/Documents/Python Scripts/print inspection/ocrstore.py", line 15, in text = image_to_string(im)
File "C:\Anaconda2\lib\site-packages\pytesser.py", line 31, in image_to_string call_tesseract(scratch_image_name, scratch_text_name_root)
File "C:\Anaconda2\lib\site-packages\pytesser.py", line 21, in call_tesseract proc = subprocess.Popen(args)
File "C:\Anaconda2\lib\subprocess.py", line 710, in init errread, errwrite)
File "C:\Anaconda2\lib\subprocess.py", line 958, in _execute_child startupinfo)
WindowsError: [Error 2] The system cannot find the file specified``
Upvotes: 0
Views: 518
Reputation: 216
Try my guide - it may work for you.
Steps for getting pytesseract working on windows.
Install pytesseract e.g. pip install pytesseract and..
import pytesseract
from PIL import Image
image = Image.open('example_02.png')
code = pytesseract.image_to_string(image)
print code
voila.
Upvotes: 0