Tesseract 4.1.1 error eng.traineddata not found in google colab

Viewed 516

I am trying to install tesseract 4.1.1 in google colab. I have installed tesseract and I can check the version using !tesseract --version. After that I have download eng.traineddata and org.traineddata in the /usr/local/share/tessdata/ folder

Now when trying to use it from python it's giving me the following error

TesseractError: (1, 'Error opening data file /usr/local/share/tessdata/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!)

I have tried to check the file exist or not using this


if os.path.isfile('/usr/local/share/tessdata/eng.traineddata'):
    print ("File exist")

which prints File exist. Any help regarding that will be appreciated. Thanks

1 Answers

Try this command

export TESSDATA_PREFIX=/usr/local/share/ 
Related