pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it‘s not in your path
·
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'
新一代开源开发者平台 GitCode,通过集成代码托管服务、代码仓库以及可信赖的开源组件库,让开发者可以在云端进行代码托管和开发。旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。
更多推荐


所有评论(0)