0

Getting following error in pytesseract importing.

Code:

from pytesseract import image_to_string
from PIL import Image

tessdata_dir_config='--tessdata-dir "C:\\Program Files (x86)\\Tesseract-OCR\\tessdata"'
im = Image.open(r'E:\\mini project\\tally.jpg')
print(im)
#text = image_to_string(im, lang = 'eng')

print(image_to_string(im,lang='eng',config=tessdata_dir_config))



<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=500x703 at 0x1B0D1E13828>

Traceback (most recent call last): File "E:\mini project\main.py", line 10, in print(image_to_string(im,lang='eng',config=tessdata_dir_config)) File "C:\Python35\lib\site-packages\pytesseract\pytesseract.py", line 136, in image_to_string nice=nice) File "C:\Python35\lib\site-packages\pytesseract\pytesseract.py", line 82, in run_tesseract proc = subprocess.Popen(command, stderr=subprocess.PIPE) File "C:\Python35\lib\subprocess.py", line 950, in init restore_signals, start_new_session) File "C:\Python35\lib\subprocess.py", line 1220, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified

Sunil
  • 3,404
  • 10
  • 23
  • 31
  • Looks like you're filesystem is missing the tesseract OCR binaries. Possible duplicate of [pytesseract cannot find the file specified](https://stackoverflow.com/questions/34225927/pytesseract-cannot-find-the-file-specified) – Evan Jan 23 '18 at 06:54
  • Possible duplicate of [pytesseract cannot find the file specified](https://stackoverflow.com/questions/34225927/pytesseract-cannot-find-the-file-specified) – georgexsh Jan 23 '18 at 06:54

0 Answers0