- 系统:Mac os x
- 工具:PyCharm
- Python:3.7
错误:
pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your path
原因:
pytesseract 在调用的tesseract的时候没有找到对应的执行文件
我的解决方法:
在终端输入命令:brew list tesseract
会看到如下的信息:/usr/local/Cellar/tesseract/4.0.0_1/bin/tesseract
修改:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pytesseract/pytesseract.py", line 186, in run_tesseract
# CHANGE THIS IF TESSERACT IS NOT IN YOUR PATH, OR IS NAMED DIFFERENTLY
修改地方:tesseract_cmd = 'tesseract'
修改为 :tesseract_cmd = '/usr/local/Cellar/tesseract/4.0.0_1/bin/tesseract‘