How do I resolve a TesseractNotFoundError?

前端 未结 22 2158
情话喂你
情话喂你 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 got this error because I installed pytesseract with pip but forget to install the binary.

    On Linux

    sudo apt update
    sudo apt install tesseract-ocr
    sudo apt install libtesseract-dev
    

    On Mac

    brew install tesseract
    

    On Windows

    download binary from https://github.com/UB-Mannheim/tesseract/wiki. then add pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files (x86)\\Tesseract-OCR\\tesseract.exe' to your script. (replace path of tesseract binary if necessary)

    references: https://pypi.org/project/pytesseract/ (INSTALLATION section) and https://github.com/tesseract-ocr/tesseract/wiki#installation

提交回复
热议问题