开发者

Nginx, virtualenv, Django and PIL error

开发者 https://www.devze.com 2023-04-10 11:15 出处:网络
I have a working Django setup with DUNG. Django, Unix(ubuntu lucid), Nginx and Gunicorn. This works nice, I then installed PIL inside my Virtualenv with pip install pil.

I have a working Django setup with DUNG. Django, Unix(ubuntu lucid), Nginx and Gunicorn.

This works nice, I then installed PIL inside my Virtualenv with pip install pil.

that installed fine, but when uploading images i got the "Image is corrupt etc messag"

Then I removed PIP from virtualenv and installed aptitude install libjpeg libjpeg-dev

Now this is where I am, I now get a server error when trying to uplaod with this error:

ImportError: The _imaging C module is not installed

This is driving me insane. Im not a expert on any of this.

EDIT

i tried importing _imaging from my virtualenv python manage.py shell and got this:

libjpeg.so.8: cannot open shared object file: No such开发者_如何转开发 file or directory

Getting closer...


Don't install PIL with pip. It requires a ton of development packages of the different image format to be useful. Instead, install PIL from your OS:

aptitude install python-imaging

And then link PIL into your virtualenv.

0

精彩评论

暂无评论...
验证码 换一张
取 消