mac:tesseract is not installed or it's not in your path

开发pytesseract 图片文字识别项目,上午pycharm还能调试,下午就报错了。

如下:

pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your path

网上查了一堆都是改pytesseract.py文件的cmd,很不满意,自认为这样的改动有失水准

image

pycharm console里提示的是 it's not in your path,只是说明环境变量丢失了,重新设定你的环境变量或者用别名都可以解决这类问题:

# vim ~/.zshrc
# 增加tesseract绝对路径,.bashrc同理
> alias tesseract="/usr/local/Cellar/tesseract/4.1.1/bin/tesseract"
> source ~/.zshrc
# 设置好记得重新打开pycharm就好了,一劳永逸的非侵入式才香呢~

你可能感兴趣的:(mac:tesseract is not installed or it's not in your path)