OpenShift上的PIL / Pillow:解码器jpeg不可用

时间:2015-09-12 19:00:59

标签: django openshift python-imaging-library pillow

我在OpenShift上的Django Admin中上传图片时遇到问题:

Exception Type:     IOError
Exception Value:    decoder jpeg not available

所以我通过pip install Pillow==2.8.2 -U --force-reinstall重新安装了枕头,最后的摘要显示:

--------------------------------------------------------------------
PIL SETUP SUMMARY
--------------------------------------------------------------------
version      Pillow 2.8.2
platform     linux2 2.7.8 (default, May 19 2015, 02:50:14)
             [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
*** OPENJPEG (JPEG2000) support not available
--- ZLIB (PNG/ZIP) support available
--- LIBTIFF support available
--- FREETYPE2 support available
*** LITTLECMS2 support not available
*** WEBP support not available
*** WEBPMUX support not available
--------------------------------------------------------------------

所以我猜这会被解决,但事实并非如此......你有什么想法吗?

编辑1:下面提到的副本建议安装libjpeg-dev,但这是不可能的,因为在OpenShift中没有yum。此外,我可以列出以下包:

> ll /usr/lib*/libjpeg*
/usr/lib64/libjpeg.so -> libjpeg.so.62.0.0
/usr/lib64/libjpeg.so.62 -> libjpeg.so.62.0.0
/usr/lib64/libjpeg.so.62.0.0
/usr/lib/libjpeg.so.62 -> libjpeg.so.62.0.0
/usr/lib/libjpeg.so.62.0.0
> ll /usr/lib*/libfreetype*
/usr/lib64/libfreetype.so -> libfreetype.so.6.3.22
/usr/lib64/libfreetype.so.6 -> libfreetype.so.6.3.22
/usr/lib64/libfreetype.so.6.3.22
/usr/lib/libfreetype.so.6 -> libfreetype.so.6.3.22
/usr/lib/libfreetype.so.6.3.22

这里缺少什么东西吗?

编辑2:可能是由于缺少/usr/lib/libjpeg.so/usr/lib64中的状态还不够)但是ln -s /usr/lib/libjpeg.so.62 /usr/lib/libjpeg.so需要root支持...我该怎么办?

1 个答案:

答案 0 :(得分:0)

好的,发现:我之前安装了一个PIL版本,当我卸载PIL并单独留下Pillow时,我的问题就消失了......