问题
python3安装PIL的时候显示无法找到相对应的版本
原因
PIL是python2的库
Pillow才能支持python3
关于Pillow与PIL
PIL(Python Imaging Library)是Python一个强大方便的图像处理库,名气也比较大。不过只支持到Python 2.7。
Pillow是PIL的一个派生分支,但如今已经发展成为比PIL本身更具活力的图像处理库
解决
- 在命令行使用PIP安装:
pip install Pillow
- 或在命令行使用easy_install安装:
easy_install Pillow
- 直接在pycharm里安装
使用案例
安装完成后,使用from PIL import Image就引用使用库了。比如:
from PIL import Image
im = Image.open(“1.jpg”)
im.rotate(60).show()