原文地址: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

pytesseract——pytesseract.pytesseract.TesseractNotFoundError:

 报错原因很明确: 没有找到 tesseract

 

解决方案:

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

pytesseract——pytesseract.pytesseract.TesseractNotFoundError:

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'

pytesseract——pytesseract.pytesseract.TesseractNotFoundError:

3.运行:不报错了

pytesseract——pytesseract.pytesseract.TesseractNotFoundError:

 

相关文章:

  • 2022-01-06
  • 2022-12-23
  • 2021-04-05
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
猜你喜欢
  • 2022-03-04
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
相关资源
相似解决方案