1

When I try to perform ocr on an image to get a string using Pytesseract:

import pytesseract
import Image

im = Image.open(str('C:\\1host.jpg'))

im.load()

print pytesseract.image_to_string(im)

The following error occurs:

D:\Python27\python.exe C:/Users/user/PycharmProjects/untitled/Pytessercast.py
Traceback (most recent call last):  
  File "C:/Users/user/PycharmProjects/untitled/Pytessercast.py", line 7, in <module>  
    print pytesseract.image_to_string(im)
  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_tesseract
  File "D:\Python27\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "D:\Python27\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] 
user
  • 5,370
  • 8
  • 47
  • 75

0 Answers0