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‘

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