I\'m using Ubuntu and VitualEnv for my Django project.
I have PIL library installed using Synaptic Package Manager and it is working fine. But when I create an Vitru
A solution that seems to work for us (as of PIL 1.7.7) is to uninstall PIL first and then Pillow and then pip install pillow --upgrade. Of course you need to have libjpeg8-dev installed.
This thread on ubuntu forums covers this topic.
And just in case, if you are using virtualenv, you don't need to need to create system-wide symlinks, here is the universal workaround that works on any architecture:
ln -s /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/libz.so $VIRTUAL_ENV/lib/
ln -s /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/libfreetype.so $VIRTUAL_ENV/lib/
ln -s /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/libjpeg.so $VIRTUAL_ENV/lib/
And you need to execute these line inside virtualenv activated shell session, symlinks will be created inside your virtualenv lib
directory.
Command dpkg-architecture -qDEB_HOST_MULTIARCH
is being used to detect main system libs directory (uname -i
is not reliable). And environment variable $VIRTUAL_ENV
is set by virtualenv activate
script.