2

I am new in Tess4J. I'm getting this error

Error opening data file ./tessdata/eng.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory. Failed loading language 'eng' Tesseract couldn't load any languages! Empty page!!

After searching, I added environment variable TESSDATA_PREFIX pointing to "C:\Program Files\Tesseract-OCR\tessdata" which has eng.traineddata file.

How can I get this to work. Please help, step by step if possible.

Mazolo
  • 307
  • 4
  • 19

2 Answers2

1

The datapath should be set to "C:\Program Files\Tesseract-OCR\".

nguyenq
  • 8,212
  • 1
  • 16
  • 16
0

First,you need to download the language data file.

Then,set the environment variable to point to your tessdata directory.

Ex:if your tessdata path is '/usr/local/share/tessdata'

export TESSDATA_PREFIX='/usr/local/share/' 

Finally,move the language data files to the tessdata directory:

sudo mv Downloads/eng.traineddata /usr/local/share/

now,try~

nikita
  • 11
  • 2
  • These instructions will not work for this exact question; you can see that the OP is using Windows from the question context, and therefore `export`, `sudo`, `mv`, and all the paths you mention will not exist. @nguyenq's answer is the correct answer to OP's question, but perhaps this answer should remain and be edited to clearly state it refers to a Linux environment? – Eric Lindsey Nov 03 '20 at 10:51