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