Guibot – Error opening eng.traineddata file

  python, python-tesseract

When using guibot I have this error :

pytesseract.pytesseract.TesseractError: (1, ‘Error opening data file ../misctessdata/eng.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language ‘eng’ Tesseract couldn’t load any languages! Could not initialize tesseract.’)

Tesseract works well by himself and it’s only when using it with guibot that I have an error.

My environment variable is set : Here

Here’ my code :

from guibot.target import Image, Text
from guibot.finder import *

import pytesseract

from guibot.guibot import GuiBot
pytesseract.pytesseract.tesseract_cmd = r'C:/Program Files/Tesseract-OCR/tesseract.exe'
game = Text('WJC')
guibot = GuiBot()
text_region = GuiBot(cv=TextFinder())
text_region.click(game)

I think I need to change the guibot.finder.py file the set my tessdata folder.
Here’s two helpful link on github but I am not able to understand the solution: https://github.com/intra2net/guibot/issues/27 and https://github.com/intra2net/guibot/issues/29

Source: Python Questions

LEAVE A COMMENT