1、安装tesseract-ocr软件
这个没什么问题出现,详情看https://blog.csdn.net/testcs_dn/article/details/78697730
2、安装tesseract
这个直接python -m pip install tesseract,也没什么问题
3、安装tesserocr
报错
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
这个直接安装whl文件
详细参考https://blog.csdn.net/coolcooljob/article/details/80385711
linux环境则没有这个问题
4、from PIL import Image报错的问题
python3中的PIL模块改成了PIllow模块,安装后就可以直接用PIL导入Pillow模块
python -m pip install Pillow
5、File "tesserocr.pyx", line 2401, in tesserocr._tesserocr.image_to_text
RuntimeError: Failed to init API, possibly an invalid tessdata path: C:\Users\Star Platinum\AppData\Local\Programs\Python\
把安装的tesseract-ocr文件夹里的tessdata放到python文件目录下
6、module ConfigParse Not Found模块找不到的问题
python3中的ConfigParse.py文件名字改成了configparse.py,修改一下__init__.py中的ConfigParse为configparse就好,一共两个地方要改,不要改多了
7、result = tesserocr.image_to_text(image)中image_to_text()在pycharm显示找不到的问题
这个只是显示,能正常使用。详细情况应该和pycharm有关。