1
votes

I installed Django (1.11) on a Python (3.6.3) virtual environment running on a Ubuntu 16.04 LTS server. My Django app contains images and Django dev server won’t start without Pillow installed. I’m having a hard time trying to install Pillow.

From what I found in the docs there are no Pillow wheels for linux. Pip try to build it from source but fail to install with the error message that “The headers or library files could not be found for zlib”. I tried to install zlib (zlib1g-dev) with apt get but the installation still fails.

I’m new to linux and all these “build from source” things are kind of scary. Any hints …

Thanks

Francois

2

2 Answers

1
votes

I found a solution to my own question. It might help somebody in the same situation so here it is

I installed zlib library

sudo apt-get install zlibg1-dev

and then I installed python3.6-dev package. I already had python-dev package but not python3.6-dev package and apparently that was the one missing

sudo apt-get install python3.6-dev

then pip (the one in the virtual environement) worked fine and managed to "build the wheel" and install Pillow

Francois

0
votes

please try this

sudo apt-get install python-imaging

for Ubuntu.