步骤:
brew update
brew install tesseract
pip install pytesseract
去往https://github.com/tesseract-ocr/tessdata下载中文数据集chi_sim.traineddata,把它放到这目录下:
?如果你用homebrew安装tesseract后的路径不在上面图片位置,请用以下命令查询安装路径:
查看所有安装的列表:
brew list
查看具体软件位置,比如tesseract:
brew list tesseract
/opt/homebrew/Cellar/tesseract/4.1.3/bin/tesseract
/opt/homebrew/Cellar/tesseract/4.1.3/include/tesseract/ (19 files)
/opt/homebrew/Cellar/tesseract/4.1.3/lib/libtesseract.4.dylib
/opt/homebrew/Cellar/tesseract/4.1.3/lib/pkgconfig/tesseract.pc
/opt/homebrew/Cellar/tesseract/4.1.3/lib/ (2 other files)
/opt/homebrew/Cellar/tesseract/4.1.3/share/tessdata/ (36 files)
所以brew安装的软件在/opt/homebrew/Cellar/目录下面。
|