View Single Post
Old 11-18-2018, 05:38 AM   #1619
gg4u
Junior Member
gg4u understands when you whisper 'The dog barks at midnight.'gg4u understands when you whisper 'The dog barks at midnight.'gg4u understands when you whisper 'The dog barks at midnight.'gg4u understands when you whisper 'The dog barks at midnight.'gg4u understands when you whisper 'The dog barks at midnight.'gg4u understands when you whisper 'The dog barks at midnight.'gg4u understands when you whisper 'The dog barks at midnight.'gg4u understands when you whisper 'The dog barks at midnight.'gg4u understands when you whisper 'The dog barks at midnight.'gg4u understands when you whisper 'The dog barks at midnight.'gg4u understands when you whisper 'The dog barks at midnight.'
 
Posts: 7
Karma: 42206
Join Date: Nov 2018
Device: Kindle 8
Tesseract 4.0.0 - environment variable cannot find tessdata (mac)

Hello everybody, Willus thank you so much for having taken time to help in this.

Im Mac user, still 10.9, I had to install tesseract via brew.
Tesseract version 4.0.0.

Folder of tessdata is:

/usr/local/Cellar/tesseract/4.0.0/share/tessdata/

Now, I set environment variable as:

export TESSDATA_PREFIX=/usr/local/Cellar/tesseract/4.0.0/share/

( I tried also without last slash:
export TESSDATA_PREFIX=/usr/local/Cellar/tesseract/4.0.0/share )

But I keep having error that cannot pick up the tessdata files (I m using command line):


Initializing OCR for 4 threads xxxx
Could not find Tesseract data (env var TESSDATA_PREFIX = /usr/local/Cellar/tesseract/4.0.0/share/).
Using GOCR v0.50.



Note tessdata folder contains:
configs eng.traineddata osd.traineddata pdf.ttf tessconfigs


Maybe a change in the version files from tesseract 3. to 4. ?
Or am I mistyping something with env var?

As test, I exctracted a tif file from a pdf with ghostscript, run tesseract:
tesseract -l eng mypdf.tif mypdf

it works.


Can you help fix k2pdfopt be able recognise tesseract installation ?
gg4u is offline   Reply With Quote