How do I resolve a TesseractNotFoundError?

前端 未结 22 2206
情话喂你
情话喂你 2020-11-28 05:14

I am trying to use pytesseract in Python but I always end up with the following error:

    raise TesseractNotFoundError()
pytesseract.pytesseract.TesseractNo         


        
22条回答
  •  余生分开走
    2020-11-28 05:34

    I'm running on a Mac OS and installed tesseract with brew so here's my take on this. Since pytesseract is just how you can access tesseract from python, you have to specify where tesseract is already on your computer.

    For Mac OS

    Try finding where the tesseract.exe is- if you installed it using brew, on your the terminal use:

    >brew list tesseract
    

    This should list where your tesseract.exe is, somewhere more or less like

    > /usr/local/Cellar/tesseract/3.05.02/bin/tesseract
    

    Then following their instructions:

    pytesseract.pytesseract.tesseract_cmd = r''
    

    pytesseract.pytesseract.tesseract_cmd = r'/usr/local/Cellar/tesseract/3.05.02/bin/tesseract'

    should do the trick!

提交回复
热议问题