TESSDATA_PREFIX not working

39 views
Skip to first unread message

Dylan Estrada

unread,
Apr 25, 2021, 3:05:17 AM4/25/21
to tesseract-ocr
Hi,

I've installed tesseract 4.1.1 on my Ubuntu 16.04 VM from source following this tutorial. 

I've also downloaded the eng.traineddata and osd.traindeddata into my tessdata folder as well as set my TESSDATA_PREFIX environment variable to the tessdata folder which can both be seen in the photo below. 
photo_below.png

However, after all of this, when I try to run tesseract --list-langs I get this error message.
error.png

I'm not quite sure what the issue here is. Any help is very appreciated!

Dylan Estrada

unread,
Apr 25, 2021, 3:13:08 AM4/25/21
to tesseract-ocr
I managed to solve the problem between submitting my question and it becoming approved.  My solution in case anyone else runs into this problem is below.

The problem seemed to be that I had tried to run tesseract with my .traineddata files in a location other than /usr/local/share/tessdata and it was confusing tesseract.  I ended up creating a new VM, installing tesseract, and then installing my .traineddata files directly to /usr/local/share/tessdata.  This new tutorial was very helpful and mentions this step that the previous tutorial left out.

My guess is that this happened because I set a environment variable to a new location tesseract ended up checking both locations, finding the .traineddata files in one of them and not the other, and then printing the failed to load and the successful outputs.  I would advise not trying to deal with the TESSDATA_PREFIX variable at all and making sure to install those files directly to where tesseract expects them to be.
Reply all
Reply to author
Forward
0 new messages