Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

No OCR tool found #13

Closed
Williamvdb opened this issue Jan 26, 2014 · 8 comments
Closed

No OCR tool found #13

Williamvdb opened this issue Jan 26, 2014 · 8 comments

Comments

@Williamvdb
Copy link

I have tesseract installed. I have used it many times before, but when I use this script:

from PIL import Image
import sys

import pyocr
import pyocr.builders

tools = pyocr.get_available_tools()
if len(tools) == 0:
    print("No OCR tool found")
    sys.exit(1)
tool = tools[0]
print("Will use tool '%s'" % (tool.get_name()))


langs = tool.get_available_languages()
print("Available languages: %s" % ", ".join(langs))
lang = langs[0]
print("Will use lang '%s'" % (lang))


txt = tool.image_to_string(Image.open('test.png'),
                           lang=lang,
                           builder=pyocr.builders.TextBuilder())
word_boxes = tool.image_to_string(Image.open('test.png'),
                                  lang=lang,
                                  builder=pyocr.builders.WordBoxBuilder())
line_and_word_boxes = tool.image_to_string(
        Image.open('test.png'), lang=lang,
        builder=pyocr.builders.LineBoxBuilder())

It says there is no OCR tool found. Any fix?

@jflesch
Copy link
Member

jflesch commented Jan 27, 2014

I need more information:

  • Which OS / GNU/Linux distribution do you use ?
  • Is tesseract in your PATH ?

@Williamvdb
Copy link
Author

@jflesch I use mac. is this not supposed to work on a mac?

If it is, though, how do I put tesseract in my path?

@jflesch
Copy link
Member

jflesch commented Jan 28, 2014

https://github.com/jflesch/pyocr#readme

It has been tested only on GNU/Linux systems. It should also work on similar systems (*BSD, etc). It doesn't work on Windows, MacOSX, etc.

I have no Mac. I can't test it on Mac, so I can't support it. Sorry.

@jflesch jflesch closed this as completed Jan 28, 2014
@deqiu
Copy link

deqiu commented Dec 31, 2016

@jflesch I use it on Win10, and I also get ''No OCR Tool Found''. Doesn't it support windows?

@jflesch
Copy link
Member

jflesch commented Dec 31, 2016

It does support Windows (see https://openpaper.work/download ). However, Tesseract.exe must be in your PATH.

@viswa20
Copy link

viswa20 commented Apr 4, 2017

hi @jflesch i can't found any exe in your package. Can you help me on this

@jflesch
Copy link
Member

jflesch commented Apr 4, 2017

There are no .exe in Pyocr. Pyocr is a Python module designed to make it easier to use OCR tools from Python.

Pyocr looks for the OCR tools (Tesseract, Cuneiform, etc) installed on your system and just tells you what it has found.

You have to install Tesseract by yourself.

@viswa20
Copy link

viswa20 commented Apr 4, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants