win64 python安装PIL出错

来源:互联网 发布:数据安全保密制度 编辑:程序博客网 时间:2024/06/06 07:43

        第三方库Python Imaging Library是Python下非常强大的处理图像的工具库。一般来说,第三方库都会在Python官方的pypi.python.org网站注册,要安装一个第三方库,必须先知道该库的名称,可以在官网或者pypi上搜索,比如Python Imaging Library的名称叫PIL,因此,安装Python Imaging Library的命令就是:pip install PIL

    我安装的是python2.7,在安装PIL时,错误提示为: 

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

解决方法:

1)先在cmd输入pip install wheel安装wheel;

2)找一个非官方网站通用的PIL安装,如:http://www.lfd.uci.edu/~gohlke/pythonlibs/;下载你需要的pillow版本(如果你的python是2.7版本就下载cp27的,3.5就下载cp35),然后用cmd命令打开下载的文件,安装成功后就能用了。但是刚开始我下载了64位的pillow,安装时出现错误:Pillow-4.3.0-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.,而用32位pillow才安装成功。

另外,我用这个方法安装pillo后,使用import Image命令时提示 ImportError: No module named Image,解决方法为将所有用到的Image修改位PIL.Image.

原创粉丝点击