I have this problem in my web application in Tomcat 9:
Error opening data file ./tessdata/eng.traineddata Please make sure the TESSDATAPREFIX environment variable is set to the parent directory of your "tessdata" directory. Failed loading language 'eng' Tesseract couldn't load any languages!
I create folder C:\Tess4J from Tess4J 3.0.4 zip, with subfolders:
In catalina.properties i add:
In environments i try to add both, and doesn't work:
Then i invoke my servlet whit doOCR method, and i've got error.
May you help me please?
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!
When you are using tesseract to recognize text from an image in python, you may get this error: pytesseract.pytesseract.TesseractError: (1, 'Error opening data file \Program Files (x86)\Tesseract-OCR\eng.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
C:\Program Files (x86)\Tesseract-OCR\ essdatais the directory of Tesseract-OCR tessdata. Run this code, you will find this error is fixed. Category: Python
You have to choose the up directory, in your case C:\Tess4J
, try it:
tessInst= new Tesseract();
tessInst.setDatapath("C:\\Tess4J");
tessInst.setLanguage("eng");
Sorry about my english
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With