- 系統: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‘