python 安装tesserocr 坑多

1.安装Tersseract

相关链接:

tesserocr GitHub:https//github.com/sirfz/tesserocr

tesserocr PyPI:https://pypi.python.org/pypi/tesserocr

tesseract下载地址:http : //digi.bib.uni-mannheim.de/tesseract

tesseract GitHub:https//github.com/tesseract-ocr/tesseract

tesseract语言包:https//github.com/tesseract-ocr/tessdata

tesseract文档:https//github.com/tesseract-ocr/tesseract/wiki/Documentation

next到底就行了

2.安装tesserocr和pillow模块

2.1tesserocr

我安装时出现了以下错误

后来通过whl来安装才最终成功的

whl安装包下载链接

Releases · simonflueckiger/tesserocr-windows_build · GitHub

把下载下来的安装包放在python安装路径里

此处特别注意,需要和tesseract匹配合适的版本

选择合适的版本下载   运行pip3 install tesserocr-2.2.2-cp36-cp36m-win_amd64.whl

加粗斜体的是下载下来的文件名。

2.2安装pillow

没什么问题 直接运行  pip3 install pillow就行了 若还是有问题,应该也可以用whl进行安装

3在pycharm运行出现报错的原因

出现以下报错

Failed to init API, possibly an invalid tessdata path: C:\\

解决办法是将C:\Program Files (x86)\Tesseract-OCR  的tessdata文件夹copy到python的安装路径中

猜你喜欢

转载自blog.csdn.net/weixin_40244676/article/details/102470216