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...
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
- Does 'C:\Program Files\Tesseract-OCR/eng.traineddata' exists?
- Did you check if file is not corrupted (e.g. you downloaded it correctly)
- From which (tessdata repository) source you downloaded it?
- Adding
TESSDATA_PREFIXto paths is useless: you have to setup env variableTESSDATA_PREFIX. - Provide full code how you setup and run pytesseract. Showing only (part of) error message does not help.