tesseract is not installed or it's not in your PATH

Tesseract-OCR已经安装

$ tesseract -v
tesseract v5.2.0.20220708
 leptonica-1.78.0
  libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.5.3) : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11 : libwebp 0.6.1 : libopenjp2 2.3.0
 Found AVX
 Found SSE4.1
 Found libarchive 3.5.0 zlib/1.2.11 liblzma/5.2.3 bz2lib/1.0.6 liblz4/1.7.5 libzstd/1.4.5
 Found libcurl/7.74.0 OpenSSL/1.0.2o (Schannel) zlib/1.2.11 zstd/1.4.5 WinIDN libssh2/1.7.0 nghttp2/1.31.0

但是使用 pytesseract.image_to_string()时报错

  pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your PATH. See README file for more information.

问题产生的原因:

  没有找到 tesseract.exe 的位置

找到 pytesseract源码

tesseract_cmd = 'tesseract'

修改为Tesseract-OCR安装的目录,如:

tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe' 

 

posted @   慕尘  阅读(1046)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
历史上的今天:
2016-09-16 Ubuntu下sphinx使用
点击右上角即可分享
微信分享提示