V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
songdg
V2EX  ›  Python

anaconda3 上安装的 pytesseract 不能用,是没正确安装还是其他问题。

  •  
  •   songdg · 2018-09-06 10:16:25 +08:00 · 3881 次点击
    这是一个创建于 2053 天前的主题,其中的信息可能已经有所发展或是发生改变。
    pytesseract.image_to_string(image)
    Traceback (most recent call last):

    File "<ipython-input-14-e63aa9f2dc4e>", line 1, in <module>
    pytesseract.image_to_string(image)

    File "C:\ProgramData\Anaconda3\lib\site-packages\pytesseract\pytesseract.py", line 294, in image_to_string
    return run_and_get_output(*args)

    File "C:\ProgramData\Anaconda3\lib\site-packages\pytesseract\pytesseract.py", line 202, in run_and_get_output
    run_tesseract(**kwargs)

    File "C:\ProgramData\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

    Help on package pytesseract:

    NAME
    pytesseract

    PACKAGE CONTENTS
    pytesseract

    FILE
    c:\programdata\anaconda3\lib\site-packages\pytesseract\__init__.py
    6 条回复    2018-09-07 17:21:41 +08:00
    nyanyh
        1
    nyanyh  
       2018-09-06 11:34:19 +08:00
    pytesseract 只是 Python 接口,还要单独装 tesseract 并加入 PATH 环境变量才可以
    jy02201949
        2
    jy02201949  
       2018-09-06 12:22:05 +08:00
    直接用 tesseract 吧
    beforeuwait
        3
    beforeuwait  
       2018-09-06 15:55:42 +08:00
    你 pip 了后
    机器还要安装一个啊
    在 debian 下
    apt-get install tesseract
    beforeuwait
        4
    beforeuwait  
       2018-09-06 15:56:18 +08:00
    1 楼说的没错
    songdg
        5
    songdg  
    OP
       2018-09-07 09:45:57 +08:00
    谢谢各位,现在可以运行了,但是不能识别中文,可是 Tesseract-OCR 已经装了中文( tessdata 文件夹了已经有 chi_sim.traineddata )。
    songdg
        6
    songdg  
    OP
       2018-09-07 17:21:41 +08:00
    加了 lang='chi_sim'就能识别中文了,不知道还有没有其他参数识别图片上某一个地方的。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2768 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 05:45 · PVG 13:45 · LAX 22:45 · JFK 01:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.