ImportError: No module named PIL.Image解决

运行某程序的时候,出现以下错误

ImportError: No module named PIL.Image

PIL是Python Image Library, 尝试用以下命令安装

pip3 install PIL 

 

结果提示:

Collecting PIL
  Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL

原因在于Python3.5?之后,已经改用Pillow了,安装Pillow可以解决

pip3 install pillow

参考:https://librabuch.jp/blog/2013/05/python_pillow_pil/

你可能感兴趣的:(Python,学习笔记)