41

I have installed tesseract OCR and it has only 'eng' and 'osd' in the language list. I need german language. I tired following command

brew install tesseract-ocr-deu

but i am getting error.

Error: No available formula with the name "tesseract-ocr-deu" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
   git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
1

5 Answers 5

42

On mac OS type

brew install tesseract-lang 

Installs all languages, you can check them by,

tesseract --list-langs
Sign up to request clarification or add additional context in comments.

2 Comments

Is it possible, to install just one specific language? Something like brew install tesseract-deu, which just installs the german one. Unfortunately this only gives me These similarly named formulae were found: tesseract ✔ tesseract-lang ✔ To install one of them, [...] Error: No previously deleted formula found. [...] Error: No formulae found in taps.
No need to install tesseract-[LANGUAGE] after installing tesserect-lang. German, Spanish and many more should be available.
25

For completeness, I am adding an answer on how to install and use a non-English language with Tesseract OCR on Linux. Since this is the first result I got on Google and I think it may help someone.

To install German language on Ubuntu/Debian/Linux Lite:

$ sudo apt-get install tesseract-ocr-deu

Language codes of all supported languages can be found here.

To specify the language in OCR engine use option: -l lang, e.g. for German:

$ tesseract -l deu 'imagename' 'stdout'

Comments

18

With Homebrew, this works: (tested on MacOS Sonoma 14.5)

brew install tesseract-lang

2 Comments

how do you specify the language?
It downloads all 163 available languages.
11

I had to install Italian language but tesseract-lang installation cost 164 files, 654.0MB and gives the less precise version fast vs best so I decided to go manual

Add path to shell (if you brew on Mac find your path with brew info tesseract)

export TESSDATA_PREFIX=/usr/local/Cellar/tesseract/5.1.0/share/tessdata/

Update profile (if you are on zsh)

source ~/.zshrc

Save the language in my case the best version of ita

wget -O $TESSDATA_PREFIX/ita.traineddata https://github.com/tesseract-ocr/tessdata/raw/main/ita.traineddata

Now you should see the added language

tesseract --list-langs

1 Comment

I had to use export TESSDATA_PREFIX=/opt/homebrew/Cellar/tesseract/5.2.0/share/tessdata and also had to use brew install wget but thanks for steering me right :)
5

You download them from tesseract repository.

At the moment tessdata for 4.0 is available here and tessdata for 3.04 here.

1 Comment

Move to: /opt/homebrew/Cellar/tesseract/5.3.3/share/tessdata/

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.