PIL/JPEG库:“解码器jpeg不可用" [英] PIL /JPEG Library: "decoder jpeg not available"

查看:83
本文介绍了PIL/JPEG库:“解码器jpeg不可用"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用PIL在django应用程序中使用PIL进行一些JPEG工作,但出现此IOError ..不确定该怎么做.

I tried to use PIL to do some JPEG work in my django app with PIL but I'm getting this IOError.. not sure what to do.

""decoder jpeg not available""

我是否从服务器中缺少JPEG解码器?如果是这样,我该如何解决?

Am I missing the JPEG decoder from my server? If so, how do I fix it?

推荐答案

您需要先安装jpeg库,然后重新安装PIL.例如,我正在使用CentOS,要安装libjpeg,请运行

You need to install jpeg library first and reinstall your PIL. For example, I'm using CentOS, to install libjpeg, I run

sudo yum install -y libjpeg-devel

这取决于您使用的是哪种Linux.在这里,您必须删除旧的PIL

It depends on what kind of linux you are using. And here you have to remove the old PIL

rm -rf /usr/lib/python2.6/site-packages/PIL-1.1.7-py2.6-linux-x86_64.egg/

然后安装PIL

sudo easy_install PIL

这篇关于PIL/JPEG库:“解码器jpeg不可用"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆