解决Python的pytesseract库执行时报错

2015/8/23 1:42 上午

使用pytesseract库识别验证码时遇到以下报错

AttributeError: 'NoneType' object has no attribute 'bands'

修改PIL库site-packages/PIL/Image.py1496行

def split(self):
    “Split image into bands”

    if self.im.bands == 1:

def split(self):
    “Split image into bands”
    self.load()
    if self.im.bands == 1:

即可。