pytesseract——pytesseract.pytesseract.TesseractNotFoundError:


原文地址:https://blog.csdn.net/qq_36853469/article/details/91572797

 

windows環境下使用pytesseract識別驗證碼中文字時報錯:

          pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your path

 報錯原因很明確: 沒有找到 tesseract

 

解決方案:

    1.找到python的安裝路徑下的pytesseract:   例如我的是   E:\Python3.7.1\Lib\site-packages\pytesseract

2.用文本編輯器打開,查找tesseract_cmd

將原來的   tesseract_cmd = 'tesseract' 改為:  tesseract_cmd = 'OCR的安裝路徑下的tessract.exe'

例如我的是   tesseract_cmd = 'C:\Program Files\Tesseract-OCR\\tesseract.exe'

注意有的地方需要轉義   例如 \\tesseract.exe,或者也可直接加r轉義

tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'

3.運行:不報錯了

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM