29

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.
Lama Madan
  • 617
  • 1
  • 10
  • 22

5 Answers5

28

On mac OS type

brew install tesseract-lang 

Installs all languages, you can check them by,

tesseract --list-langs
Sahana M
  • 485
  • 6
  • 4
  • 3
    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.` – Cadoiz Oct 06 '22 at 11:57
15

With Homebrew, this works: (tested on MacOS Mojave 10.14.3)

   brew install tesseract-lang
Cadoiz
  • 1,446
  • 21
  • 31
weivall
  • 917
  • 13
  • 16
15

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'
Cadoiz
  • 1,446
  • 21
  • 31
Marko Lalovic
  • 259
  • 2
  • 5
6

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
Ax_
  • 803
  • 8
  • 11
  • 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 :) – Grant Nov 04 '22 at 03:35
4

You download them from tesseract repository.

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

Dmitrii Z.
  • 2,287
  • 3
  • 19
  • 29