【发布时间】:2014-09-07 18:08:48
【问题描述】:
我通过这样做安装了枕头
pip install Pillow
我没有安装 PIL。在我安装 Pillow 之后,它说:
ZLIB (PNG/ZIP) support not available
当我尝试创建 PNG 图像的缩略图时,它给了我一个错误提示
IOError at /createThumbnail/
decoder zip not available
我阅读了 Pillow 文档 (http://pillow.readthedocs.org/en/latest/handbook/image-file-formats.html#png),它说为了获得 PNG 支持,我需要“在构建 Python 映像库之前构建并安装 ZLIB 压缩库。有关详细信息,请参阅分发自述文件”。我阅读了原始的 PIL README (http://pillow.readthedocs.org/en/latest/original-readme.html),它说要安装
sudo apt-get install zlib1g-dev
我这样做了,Pillow 仍然不支持 PNG 文件。我什至尝试重新安装 Pillow,但也没有用。知道如何让 Pillow 支持 PNG 文件吗?
编辑: 我从这里下载 zlib: http://zlib.net/
然后按照此处的说明进行操作: http://petio.org/tools/zlib.html
我基本上只是提取下载的文件,然后从目录中运行这些代码:
$ ./configure -s --prefix=/usr
$ make
$ sudo su
make install
然后我卸载并重新安装了 Pillow,它现在确实支持 PNG,但是,我仍然收到完全相同的错误消息(解码器 zip 不可用)..知道为什么吗?
【问题讨论】:
标签: python png python-imaging-library zlib pillow