Pyocr doesn't recognize get_available_languages
Question: Im using Python and can't load languages from package pyocr.

    
    
    from PIL import Image
    import sys
    import pyocr
    from pyocr import builders
    im=Image.open("Img1.gif")
    tool=pyocr.get_available_tools()
    lang = tool.get_available_languages()[0]
    

here I got "list object has no attribute 'get_available_languages'

Any ideas of how to solve it? I've never used pyocr.

Thanks


Answer: The `tools` is a list, and you need to iterate over them; the items are
individual tools:

    
    
    for tool in pyocr.get_available_tools():
        for lang in tool.get_available_languages():
            print("Tool {} supports language {}".format(tool, lang))
    

Alternatively, say you know you want to use `tesseract`, you can import it
directly:

    
    
    from pyocr import tesseract as tool
    

However the list of tools reflects the programs that are installed on the
system; to enable the `tesseract` tool in `pyocr` you need to install the
separate `tesseract` program. If it is found in the command path, the
`get_available_tools()` will list tesseract. The other tool supported by
`pyocr` is `cuneiform`.

