I'm using pytesseract in python 3.x and trying to convert an image into text.
Running the code:
from pytesseract import image_to_string
from PIL import Image
im = Image.open('image.bmp')
print(im)
print(image_to_string(im)
gives the output:
>>> ================================ RESTART ================================
>>>
<PIL.BmpImagePlugin.BmpImageFile image mode=RGB size=563x558 at 0x2D9C350>
Traceback (most recent call last):
File "C:\Users\ADMIN\Desktop\image.py", line 6, in <module>
s= image_to_string(im)
File "C:\Python34\lib\site-packages\pytesseract\pytesseract.py", line 161, in image_to_string
config=config)
File "C:\Python34\lib\site-packages\pytesseract\pytesseract.py", line 94, in run_tesseract
stderr=subprocess.PIPE)
File "C:\Python34\lib\subprocess.py", line 848, in __init__
restore_signals, start_new_session)
File "C:\Python34\lib\subprocess.py", line 1104, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
>>>
PIL seems to be loading the image just fine, but pytesseract is throwing FileNotFoundError and I have no idea why. Any help much appreciated!