18π
I installed libjpeg and PIL on Snow and it was migrated without problems to Lion.
I think however that you have the same problem I faced with installing libjpeg 7 on Snow. The solution for me was :
- Make sure that you are NOT using GCC 4.0. That means those export lines in your .bash_profile file that you needed to get MySQLdb
working now need to go away.- get (http://www.ijg.org/files/jpegsrc.v7.tar.gz) and do the usual ./configure && make && make install (or whatever the readme says).
- Before installing PIL but after installing libjpeg, change the βJPEG_ROOT = Noneβ line in my setup.py file to βJPEG_ROOT =
libinclude(β/usr/localβ)β
I got this from a comment on this blog.
Afterwards you can reinstall PIL through pip or easy_install. Make sure all the compiled stuff from your last run is deleted (sometimes you need to do this manually). I used virtualenv and pip.
93π
In our virtualenv we found all we needed to do was:
pip uninstall PIL
brew install libjpeg
pip install PIL
which is simpler than some of the above and may be enough for others with this problem too.
Although there was an xcode warning on the brew and a setup.py package warning on the reinstall of PIL, all the tests that previously failed with jpeg decode errors successfully ran after just the quick action above.
- [Django]-PyCharm can't find the right paths if I open a directory that is not the Django root
- [Django]-XlsxWriter object save as http response to create download in Django
- [Django]-Django Rest Framework β APIView Pagination
16π
Make sure you have homebrew and pip, and then run:
brew install libjpeg
pip install pil
- [Django]-Django "get() got an unexpected keyword argument 'pk'" error
- [Django]-Handle `post_save` signal in celery
- [Django]-Get request data in Django form
11π
I used the following binary to get libpng and libjpeg installed systemwide on OSX:
Because I already had PIL installed (via pip on a virtualenv), I ran:
pip uninstall PIL
pip install PIL --upgrade
This resolved the decoder JPEG not available
error for me.
UPDATE:
If encountering the error encoder jpeg not available
, you may need to install libjpeg
. If using Homebrew:
brew install libjpeg
- [Django]-How to combine django "prefetch_related" and "values" methods?
- [Django]-Cleanest & Fastest server setup for Django
- [Django]-How to add a new field to a model with new Django migrations?
3π
Worth noting and good information to have whenever working with Python and PIL: If you use virtualenv (and I think itβs a very good idea), PIL may not correctly detect the image libraries on your system and install without JPEG/PNG support. Use the pillow package for a compatible PIL fork that finds them correctly.
- [Django]-Install mysql-python (Windows)
- [Django]-Can "list_display" in a Django ModelAdmin display attributes of ForeignKey fields?
- [Django]-Django 1.7.1 Makemigrations fails when using lambda as default for attribute
3π
For OSX, pip install PIL had:
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform darwin 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
--------------------------------------------------------------------
--- TKINTER support available
*** JPEG support not available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
--------------------------------------------------------------------
Another post led to something that works.
Install the libraries from here.
- [Django]-Django cannot import name x
- [Django]-STATIC_ROOT vs STATIC_URL in Django
- [Django]-UUID as default value in Django model
2π
If you have macports installed, you should do a:
$ sudo port selfupdate
$ sudo port install py27-pil
Itβs easier than the easy_install + libjpeg method since macports install the right dependencies.
- [Django]-What does "'tests' module incorrectly imported" mean?
- [Django]-Django Model Field Default Based Off Another Field in Same Model
- [Django]-Substring in a django template?