美文网首页
使用tesserocr时的错误possibly an inval

使用tesserocr时的错误possibly an inval

作者: 郑贵烈 | 来源:发表于2018-11-24 11:20 被阅读0次

    错误提示:

     Traceback (most recent call last):
      File "F:/python_project/Security_code_Test/pic_Test.py", line 5, in <module>
        result=tesserocr.image_to_text(image)
      File "tesserocr.pyx", line 2407, in tesserocr._tesserocr.image_to_text
    RuntimeError: Failed to init API, possibly an invalid tessdata path: F:\python 3.7.0\/tessdata/
    

    解决办法:

    1.找到tesseract工具的安装路径,打开根目录tesseract -> Tesseract-OCR -> 找到tessdata文件夹复制
    2.粘贴在python安装目录的根目录下
    3.再次运行代码

    成功显示结果:

    "F:\python 3.7.0\python.exe" F:/python_project/Security_code_Test/pic_Test.py
    KSUB
    
    
    Process finished with exit code 0
    

    相关文章

      网友评论

          本文标题:使用tesserocr时的错误possibly an inval

          本文链接:https://www.haomeiwen.com/subject/uebeqqtx.html