报错内容
安装好tesseract后,在cmd可以运行。如下
之后在pycharm中运行时,出现报错:
pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it’s not in your path
解决方法
1、打开pytesseract.py文件:
pytesseract.py会在错误提示中,直接点击进入文件,然后查找cmd就能找到。
(我的是在C:\ProgramData\Anaconda3\Lib\site-packages\pytesseract\pytesseract.py)
2、修改pytesseract.py:
滚动到最上边,将tesseract_cmd = 'tesseract'
改为tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract.exe'
3、再次运行你原来的程序即可