AttributeError: __exit__

 File "demo_test.py", line 74, in
    img = mpimg.imread(path + image_names[-1])
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/image.py", line 1357, in imread
    im = pilread(fname)
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/image.py", line 1335, in pilread
    with Image.open(fname) as image:
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 528, in __getattr__
    raise AttributeError(name)
AttributeError: __exit__

解决: sudo pip install --upgrade Pillow

done

你可能感兴趣的:(AttributeError: __exit__)