brew安装tesseract 同时安装所有语言
最近在学习python爬虫,安装OCR库tesseract时,发现使用brew install --all-languages tesseract
命令安装时,发生错误Error: invalid option: --all-languages
。
于是尝试查看了一下info
brew info tesseract
返回信息:
tesseract: stable 4.1.0 (bottled), HEAD
OCR (Optical Character Recognition) engine
https://github.com/tesseract-ocr/
/usr/local/Cellar/tesseract/4.1.0 (65 files, 29.7MB) *
Poured from bottle on 2019-08-31 at 10:18:54
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/tesseract.rb
==> Dependencies
Build: autoconf ✔, autoconf-archive ✘, automake ✘, libtool ✔, pkg-config ✔
Required: leptonica ✔, libtiff ✔
==> Options
--HEAD
Install HEAD version
==> Caveats
This formula contains only the "eng", "osd", and "snum" language data files.
If you need all the other supported languages, `brew install tesseract-lang`.
==> Analytics
install: 62,505 (30 days), 184,542 (90 days), 518,813 (365 days)
install_on_request: 7,482 (30 days), 21,899 (90 days), 92,527 (365 days)
build_error: 0 (30 days)
可以看到Options里面没有其他选项。
具体原因和homebrew有关,网上已有大神说明了原因,homebrew官方也有解释。
可以删除option,直接使用brew install tesseract
安装,但是安装后只支持少量语言。
brew info tesseract
返回的信息里面已经说明,并且提供了需要支持多国语言版本的安装方法,如下:
brew install tesseract-lang