【问题标题】:Error 2 No such file or directory in pytesseract错误 2 在 pytesseract 中没有这样的文件或目录
【发布时间】:2016-03-13 06:40:51
【问题描述】:

我想尝试阅读简单的图像但我有以下错误:

import requests
import pytesseract
from PIL import Image
from StringIO import StringIO
from lxml import html
session=requests.Session()
cont=session.get('http://This_site.com/').content
tree=html.fromstring(cont)
token=tree.xpath(...)
session_id=token.split(...)
response=session.get('http://This_site.com/'+session_id)
captcha=pytesseract.image_to_string(Image.open(StringIO(response.content)))
print captcha

错误:

[Errno 2] No such file or directory

【问题讨论】:

    标签: python image tesseract stringio


    【解决方案1】:

    好像你没有安装tesseract-ocr,如果你使用的是基于debian的发行版,试试这个:

    $ sudo apt-get install tesseract-ocr
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-01
      • 2019-12-12
      • 2012-04-13
      • 1970-01-01
      相关资源
      最近更新 更多