arch linux python3.6.2 图像处理Pillow库未安装导致的错误

>>import matplotlib.pyplot as plt

>>plt.figure('the First Picture')

>>first_picture = plt.imread('first.jpg')

File "<stdin>", line 1, in <module>

File "/usr/lib/python3.6/site-packages/matplotlib/pyplot.py", line 2314, in imread                   
   return _imread(*args, **kwargs)                                                                  
File "/usr/lib/python3.6/site-packages/matplotlib/image.py", line 1282, in imread                      
   'more images' % list(six.iterkeys(handlers)))                                                     
ValueError: Only know how to handle extensions: ['png']; with Pillow installed matplotlib can handle more images 


错误原因:未安装Pillow库导致不能加载更多格式的图片

解决:sudo pacman -S python-pillow
安装Pillow库



猜你喜欢

转载自blog.csdn.net/lzp1510681927/article/details/78254675