I am trying to implement OCR in python. When I run the following code:
from PIL import Image
from pytesser import *
image_file = 'menu.jpg'
im = Image.open(image_file)
text = image_to_string(im)
text = image_file_to_string(image_file)
text = image_file_to_string(image_file, graceful_errors=True)
print "=====output=======\n"
print text
I get the following error:
Traceback (most recent call last):
File "C:/Python27/ocr.py", line 2, in <module>
from pytesser import *
File "C:/Python27\pytesser.py", line 6, in <module>
ImportError: No module named Image
I have a folder name pytesser
in my C:\Python27\Lib\site-packages
directory
and also one named PIL
in the same directory which is from the installation of PILLOW.
Edit: I tried the solution at Why can't Python import Image from PIL?. But it doesn't seem to help