python3无法正常安装PIL,因为PIL只支持python2各个版本,还没有python3的版本。
遇到问题:
cmd中输入pip3 install PIL,提示错误。
Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL
You are using pip version 18.1, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
找不到满足要求PIL的版本(来自版本:)
找不到PIL的匹配分发
您使用的是pip版本18.1,但是版本20.0.2是可用的。
您应该考虑通过“python-m pip install--upgrade pip”命令进行升级。
解决办法:
原因:
经过查询资料发现,python2可以使用pip install PIL安装PIL第三方包。而我们使用的是python3,现在python3已经用Pillow代替PIL。
使用 pip3 install Pillow 安装即可,效果如下:
Successfully
如果初学者学习Python,我推荐这本书籍。整本书站在初学者视角编写,例子丰富,颜色鲜明对代码重点学习非常有益。本书是我以教授孩子的角度编写的,同时全书400页包含一个Python程序员所应该掌握的详实内容。