直接下载地址:https://digi.bib.uni-mannheim.de/tesseract/
找的最新版本:
![](https://i-blog.csdnimg.cn/img_convert/44a135d552699c6ae667d23596494108.png)
![](https://i-blog.csdnimg.cn/img_convert/a7c18137deb9b93468e66f750e9b8d43.png)
我添加了math 跟chinese(因为是国内网络的原因吧,下载都失败,所以不用选择,后面自己下载后,添加到相应目录就好)
![](https://i-blog.csdnimg.cn/img_convert/ecf2001ff7292c1beb33dab098405b77.png)
![](https://i-blog.csdnimg.cn/img_convert/5d65b3e72b3ec2e6d4243f4b5db708eb.png)
配置系统环境变量
![](https://i-blog.csdnimg.cn/img_convert/c262304a669dd16bf8661ef84673ac69.png)
在cmd下测试
tesseract -v
![](https://i-blog.csdnimg.cn/img_convert/0acade4f3640057a70a9df3e5ae0a7d4.png)
import pytesseract
from PIL import Image
picture_new_path=文件路径
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
image = Image.open(picture_new_path)
text = pytesseract.image_to_string(image, lang='eng', config="--psm 6")
print(text)
![](https://i-blog.csdnimg.cn/img_convert/5f81562f29ac872407ea7a34d2a8df1c.png)
![](https://i-blog.csdnimg.cn/img_convert/f994dcef3c0ce16d57afb2f34373a673.png)
或者查看官方文档:Languages/Scripts supported in different versions of Tesseract | tessdoc