Tesseract Cannot Find Eng. Traineddata

I have python program which uses tesseract ocr engine. At first it worked fine. However I uninstall tesseract and reinstall it this time it does not work.

It gives

pytesseract.pytesseract.TesseractError: (1, 'Error opening data file C:\\Program Files\\Tesseract-OCR/eng.traineddata Please make sure the TESSDATA_PREFIX

I did not change anything, but it does not work.

I add TESSDATA_PREFIX to the path.

But when I move eng.traineddata from tesstada to tesseract-ocr file it worked. I have another computer and also it has same program and it works well. However eng.traineddata is in tessdata folder.

Why is the one program gives an error, another is not ?

EDIT

1) 'C:\Program Files\Tesseract-OCR/eng.traineddata' does not exist in two computers. However one of them is working but the other is not working. Therefore As I stated in the question, I move eng.traineddata from tessdata to Tesseract-OCR folder and then it is worked. But here is the question why one of it is working and the other is not working ? Because other program does not have eng.traineddata in the Tesseract-OCR folder.

2) I downloaded the windows executable of tesseract from mannheim uni library. So file is not corrupted.

3)I am using Tesseract 3.05

4) I have created TESSDATA_PREFIX env variable.

5) I downloaded the windows executable of tesseract from mannheim uni library.

Thank you very much.

1 Answer

  1. Does 'C:\Program Files\Tesseract-OCR/eng.traineddata' exists?
  2. Did you check if file is not corrupted (e.g. you downloaded it correctly)
  3. From which (tessdata repository) source you downloaded it?
  4. Adding TESSDATA_PREFIX to paths is useless: you have to setup env variable TESSDATA_PREFIX.
  5. Provide full code how you setup and run pytesseract. Showing only (part of) error message does not help.
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest