pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your path

import pytesseract
from PIL import Image

image = Image.open('d:/2.jpg')
text = pytesseract.image_to_string(image)
print(text)

运行时报错:pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it’s not in your path

解决办法:windows的需要下载Tesseract-OCR安装包,安装成功后,在path中增加tesseract.exe的路径
下载地址 :https://github.com/UB-Mannheim/tesseract/wiki

我的是C:\Program Files (x86)\Tesseract-OCR
然后新增语言包环境变量配置
新增变量名TESSDATA_PREFIX
路径需要赋值到tessdata
我的是C:\Program Files (x86)\Tesseract-OCR\tessdata

识别的图片信息如下:
pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your path_第1张图片
执行结果:pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your path_第2张图片
识别信息还是不怎么准确。i识别成了j

你可能感兴趣的:(pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your path)