为了账号安全,请及时绑定邮箱和手机立即绑定

我在 python 中使用 tesseract 包时出错

我在 python 中使用 tesseract 包时出错

拉莫斯之舞 2021-07-16 18:02:21
我正在尝试使用 pytesseract OCR 读取支票中的文本。我已经安装了此任务所需的 Python 包,例如 pip install pytesseract。但是,当我尝试使用该包读取文件时,出现以下错误: pytesseract.image_to_string(im,)Traceback (most recent call last):  File "<ipython-input-17-d7d9f430493b>", line 1, in <module>    pytesseract.image_to_string(im,)  File "C:\Users\BRIGHT\Anaconda3\lib\site-packages\pytesseract\pytesseract.py", line 294, in image_to_string    return run_and_get_output(*args)  File "C:\Users\BRIGHT\Anaconda3\lib\site-packages\pytesseract\pytesseract.py", line 202, in run_and_get_output    run_tesseract(**kwargs)  File "C:\Users\BRIGHT\Anaconda3\lib\site-packages\pytesseract\pytesseract.py", line 172, in run_tesseract    raise TesseractNotFoundError()TesseractNotFoundError: tesseract is not installed or it's not in your path这个错误没有意义,因为我实际上导入了包而没有出现任何错误。但是当我尝试使用它时,我得到了错误。这是我的代码:from PIL import Imageimport pytesseractim=Image.open('BritishChequeAnnotated.jpg')text=pytesseract.image_to_string(im,)
查看完整描述

2 回答

?
函数式编程

TA贡献1807条经验 获得超9个赞

您需要安装teseract可执行文件并将路径包含在程序中,然后它就不会出现任何错误


查看完整回答
反对 回复 2021-07-27
  • 2 回答
  • 0 关注
  • 392 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号