60π
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
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/
Then install the PIL
sudo easy_install PIL
73π
I have found this answer from author βedwardβ
On Ubuntu precise, PIL doesnβt find the jpeg library files, even once they are installed. The easiest way to fix this is to make a symlink after you have installed the jpeg dev package. So, I needed an extra step:
for x64 OS
pip uninstall PIL
sudo apt-get install libjpeg8-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
pip install PIL
for x32 OS
pip uninstall PIL
sudo apt-get install libjpeg8-dev
sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib
pip install PIL
I confirm that this is working for me on Ubuntu Linux 12.04.
If you are a Mac user β you need to install Xcode and Command Line Tools. Read how to do this
- [Django]-Django models: Only permit one entry in a model?
- [Django]-Sending an SMS to a Cellphone using Django
- [Django]-How should I write tests for Forms in Django?
20π
A stronger answer can be found at install pil on virtualenv with libjpeg
For me what finally worked on Ubutu was:
pip uninstall PIL
sudo apt-get install libjpeg8-dev
pip install PIL
The Python Imaging Library (PIL) seems really picky about version and location of the jpeg libraries. And because PIL is written in C and compiled, you need the development versions of the library in addition to the runtime versions.
- [Django]-How do I check for last loop iteration in Django template?
- [Django]-Silence tqdm's output while running tests or running the code via cron
- [Django]-Django: Open uploaded file while still in memory; In the Form Clean method?
6π
I donβt have sudo privileges, because I am on a shared bluehost server. So I canβt run any of those sudo apt-get jpeg commands. I ended up running
pip uninstall pil
pip install pillow
and apparently pillow was able to find support for jpegs.
- [Django]-Django ModelForm for Many-to-Many fields
- [Django]-Tailwindcss: fixed/sticky footer on the bottom
- [Django]-Django syncdb and an updated model
4π
There is a selftest.py in your Imaging installation folder, try:
python selftest.py
you will see something like that:
--------------------------------------------------------------------
*** PIL CORE support not installed
*** TKINTER support not installed
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
*** FREETYPE2 support not installed
*** LITTLECMS support not installed
--------------------------------------------------------------------
if JPEG support not available, Centos:
yum install libjpeg-devel
yum install freetype-devel
yum install libpng-devel
- [Django]-Creating Custom Filters for list_filter in Django Admin
- [Django]-How to resize the new uploaded images using PIL before saving?
- [Django]-Django character set with MySQL weirdness
3π
For macβs users, You can download the library from here: http://ethan.tira-thompson.com/Mac_OS_X_Ports.html. Then, uninstall and install PIL
- [Django]-Django dynamic model fields
- [Django]-What is pip install -q -e . for in this Travis-CI build tutorial?
- [Django]-Django celery task: Newly created model DoesNotExist
0π
You can build PIL from source: http://effbot.org/zone/pil-decoder-jpeg-not-available.htm
- [Django]-Can you give a Django app a verbose name for use throughout the admin?
- [Django]-How to go from django image field to PIL image and back?
- [Django]-Django: remove a filter condition from a queryset
- [Django]-Django return redirect() with parameters
- [Django]-How to get form fields' id in Django
- [Django]-Django Form File Field disappears on form error