1

I was having problems with Ubuntu 22.04 on my Framework laptop, and did a complete re-installation, using Ubuntu 24.04.1. I have just reinstalled Tesseract using snap. It was was working ok previously on Ubuntu 22.04, but now gives the error:

Error opening data file /snap/tesseract/current/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!
Could not initialize tesseract.

I tried to install English as follows:

sudo apt-get install tesseract-ocr-eng

which was apparently successful, but using:

tesseract --list-langs

I got the following response:

List of available languages in "/snap/tesseract/current/usr/local/share/tessdata/" (0):

and trying to translate something gave the same error as above.

I have tried searching for this problem without success. Any ideas?

Many thanks, Andrew

1 Answers1

1

If I were you, I would just install the apt version of tesseract and not the snap version:

$ sudo snap remove tesseract
$ sudo apt install tesseract-ocr tesseract-ocr-eng

After the above commands, you should have the following:

$ type tesseract
tesseract is /usr/bin/tesseract

If not, you may have to log out and then log back in and / or check your $PATH environment variable.

Also, the command

$ snap list | grep -i tesseract

should give you no output.

FedKad
  • 13,420