Tesseract python3 错误:tesseract is not installed or it's not in your path

  1. 系统:Mac os x  
  2. 工具:PyCharm
  3. 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‘

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章