安装 PyTesseract 后,我进入我的 Mac 终端以确保它正常工作。我让它完美地输出到一个文本文件中,但是在 Enthought Canopy 中运行此代码后:
import pytesseract
from PIL import Image
print pytesseract.image_to_string(Image.open('/Users/Nelson/Desktop/Projects/R6S Statistics/OCR/ocr-test.png'))
我明白了:
AttributeError: 'ImagingDecoder' object has no attribute 'pulls_fd'
此错误来自 PIL 文件:
/Users/Nelson/Desktop/Canopy/User/lib/python2.7/site-packages/PIL/ImageFile.pyc