tesseract安装
在cmd中已经可以运行并显示版本langs等
from PIL import Image
import pytesseract
text=pytesseract.image_to_string(Image.open(r'd:(1)pdf\aa.jpg'),lang='ch_sim')
print(text)
raise TesseractError(proc.returncode, get_errors(error_string))
pytesseract.pytesseract.TesseractError: (1, 'Error opening data file D:\(1)pdf\tes\tessdata/ch_sim.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language 'ch_sim' Tesseract couldn't load any languages! Could not initialize tesseract.')
配置环境变量,但是根据网络上的都已经更改过了
更改pytesseract文件内容指向,也不好使
版本不适配,python3.8 tesseract从3.05升级到4.0 也不好使。
能够进行图片分析