[python]has no attribute 'TessBaseAPI'

烂漫一生 提交于 2019-12-07 04:09:58

问题


I got an error when I compiled code blow:

import tessercat
api = tesseract.TessBaseAPI()

The error is:

AttributeError:'module' object has no attribute 'TessBaseAPI'

I have already installed tesseract via pip. The Python version is 2.7 Windows 32bit.


回答1:


I think you are trying to use python wrapper of tesseract (python-tesseract). Make sure you are using the right version. You can check this one: python-tesseract-0.7.6.win32-py2.7.exe




回答2:


Make sure that you don't need to import a sublcass ie from tesseract import XYZ

Also - not sure if this was a typo but your import module is misspelled.



来源:https://stackoverflow.com/questions/30928681/pythonhas-no-attribute-tessbaseapi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!