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
下载并安装 Tesseract OCR
找到
python
的安装路径下的pytesseract
:如:
D:\Programs\Python\Python37\Lib\site-packages\pytesseract
用文本编辑器打开
pytesseract.py
,查找tesseract_cmd
,然后将其做如下修改:1
tesseract_cmd = r'D:\Program Files\Tesseract-OCR\tesseract.exe'
D:\Program Files\Tesseract-OCR\tesseract.exe
是你 Tesseract OCR 的安装路径如图所示:
友情提示:用
tesseract
进行光学识别时记得安装以下包1
2pip install pytesseract
pip install pillow