Adding PIL support for Django in Ubuntu
For some reason that i don’t understand yet, install PIL from pip in Ubuntu simply doesn’t work, at this point i’ve found a possible solution, installing it by hand.
All we need is download PIL from here extract whenever you want:
- Navigate inside the directory Imaging.x.x.x
- Open the “setup.py” file with your favorite editor
- Go to line 214 and above add add_directory(library_dirs, “/usr/lib/i386-linux-gnu”) if you’re using a 32 bits distro or add_directory(library_dirs, “/usr/lib/x86_64-linux-gnu”) for 64 bits ones.
- After saving the file simply run “python setup.py install” and wait for a moment.
In some cases it can be necessary install libjpeg, zlib and freetype first.