Reputation: 13
I get an error when I write the following code :
img = cv2.imread(path)
#adding custom options
custom_config = r'--oem 2 --psm 6'
pytesseract.image_to_string(img, config=custom_config)
HERE is the error :
TesseractError: (1, "Error: Tesseract (legacy) engine requested, but components are not present in /usr/local/share/tessdata/eng.traineddata!! Failed loading language 'eng' Tesseract couldn't load any languages! Could not initialize tesseract.")
I need some help please (I'm on mac).
Upvotes: 0
Views: 859
Reputation: 3328
That means your eng.traineddata
has only new (LSTM) engine, but you asked tesseract to use legacy engine (--oem 2
). Download and install eng.traineddata
that has also components with legacy engine.
Upvotes: 1