Change your imports to look like this:
from PIL import Image
import sys
from pyocr import pyocr
from pyocr import builders
Now pyocr.get_available_tools()
will work because you have imported the module. But pyocr.builders.WordBoxBuilder()
wont work because builders is imported on its own namespace. You'd need to change them to builders.WordBoxBuilder()
ditto for TextBuilder and LineBoxBuilder.