2π
You get this error if PIL is compiled without jpeg support. I also got this when the destination directory was not writeable.
Once PIL has compiled, if you read
JPEG support not available
the library for handling JPEG files, or part of it, is missing. Fix this just installing the library (in my case it was libjpeg62-dev) and run pip again, maybe inside a virtualenv. If this is not enough, probably your system has some more quirk. Look at this post (ubuntuforums) for the fix.
10π
PIL need to find some libraries like libjpeg and libz during installation.
We encountered the same problems on our server and we installed PIL system-wide using
aptitude install python-imaging
This is a quick fix and it works for us.
Also googling about this show two ways how to fix this problem using PIL.
The first one is to symlink libjpeg.so
, libfreetype.so
and libz.so
from /usr/lib/x86_64-linux-gnu/
to /usr/lib
The second one is to use pip --no-install
key to download the package and then alter the setup.py to put correct paths there
1. Call 'pip install -I pil --no-install' to download and unpack the PIL source into your build directory;
2. Get into your build directory and edit setup.py;
3. Find the line that says 'add_directory(library_dirs, "/usr/lib")' (line 214 here);
4. Add the line 'add_directory(library_dirs, "/usr/lib/x86_64-linux-gnu/")' afterwards;
5. Call 'pip install -I pil --no-download' to finish the installation.
If you have i386 arch use i386-linux-gnu
instead of x86_64-linux-gnu
- [Django]-How to use dart sass in python
- [Django]-DjangoQ run manage.py qcluster results in PermissionError: [WinError5] Access is denied
- [Django]-Django on Google AppEngine with CloudSQL: How to connect database (Error 2002, Can't connect to local MySQL server..)
- [Django]-Csrf issue from node js to django
4π
if youβre using pip and virtualenv then thereβs no need to mess with system paths.
PIL installed via pip has trouble finding the relevant libraries on ubuntu 12.10 (and some earlier) on x86_64
to fix:
# commands for recent debian/ubuntu
sudo apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
for i in libjpeg.so libfreetype.so libz.so
do ln -s /usr/lib/x86_64-linux-gnu/$i $VIRTUAL_ENV/lib/
done
pip uninstall pil
pip install pil
- [Django]-South data migration from parent class to subclass clobbers parent data
- [Django]-Add CSS class to django RadioSelect label
- [Django]-Override Model.save() for FileField handled by Boto β Django
- [Django]-Building pluggable apps: how to include forks of popular libraries and prevent name conflicts?
1π
My fix for this is to make sure you have packages libjpeg-dev and libpng-dev installed before doing the pip install of PIL.
sudo apt-get install libjpeg-dev libpng-dev
will probably do. Then pip gets PIL from source, compiles with jpeg and png support.
- [Django]-How do I include an external CSS file as a rule for a class inside a .scss file?
- [Django]-Make Django not lazy-load module, for development convenience
- [Django]-Populate() isn't reentrant Django Google App Engine
- [Django]-Url contains spaces in django v3
- [Django]-Django migrations : relation already exists