一、先去https://digi.bib.uni-mannheim.de/tesseract/下载 .exe文件
二、安装python包
pip install pytesseract
解决路径找不到的问题
方法1: 修改pytesseract.py文件,指定tesseract.exe安装路径
# CHANGE THIS IF TESSERACT IS NOT IN YOUR PATH, OR IS NAMED DIFFERENTLY tesseract_cmd = 'C:\Program Files (x86)\Tesseract-OCR\tesseract.exe‘
方法2: 在实际运行代码中指定
pytesseract.pytesseract.tesseract_cmd = 'D:\Program Files\Tesseract-OCR\tesseract.exe'