tesseract is not installed or it's not in your path

前言:

windows环境下使用pytesseract识别验证码时报错:

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

原因

没有找到 tesseract

解决方案

  1. 下载并安装Tesseract OCR

  2. 找到python的安装路径下的pytesseract

    如:D:\Programs\Python\Python37\Lib\site-packages\pytesseract

  3. 用文本编辑器打开pytesseract.py,查找tesseract_cmd,然后将其做如下修改:

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

    D:\Program Files\Tesseract-OCR\tesseract.exe是你Tesseract OCR的安装路径

  4. 如图所示:

  5. **友情提示:**用tesseract进行光学识别时记得安装以下包

    1
    2
    pip install pytesseract
    pip install pillow
  6. 友情链接

本文结束 感谢您的阅读
正在加载今日诗词....