Install PIL/Pillow via pip in Debian testing (Jessie)
Solution 1
After installing the development version of Pillow, the second problem was solved as well. It may be related to this issue.
So to sum up, the solution was:
Install dependencies as Dennis said, which in my case also included downgrading the
experimental
version of libc6 withaptitude remove libc6
, which granted the option toDOWNGRADE
it to the repo's version.Installing the Pillow's trunk version with
pip install git+git://github.com/python-imaging/Pillow.git
Solution 2
In Ubuntu 14.04 try:
sudo ln -s /usr/include/freetype2 /usr/local/include/freetype
Solution 3
You need the python development headers, and possibly other development packages. Easiest way to get them is:
sudo apt-get build-dep python-imaging
Solution 4
I'm using Debian 7 testing, and for me it worked doing this:
Installing the dependencies as said by Dennis:
$ sudo apt-get build-dep python-imaging
Making a symbolic link as suggested by mrudult:
$ sudo ln -s -T /usr/include/freetype2/ /usr/include/freetype
Install Pillow as usual:
$ pip install Pillow
Solution 5
On a fresh Ubuntu 14.04 install on DigitalOcean, I was able to solve this problem by simply running
sudo apt-get install python-dev
and then re-running the pip install command inside the python venv
pip install Pillow
Related videos on Youtube
alxs
Updated on September 18, 2022Comments
-
alxs over 1 year
On Debian testing (Jessie), when I try to install PIL or Pillow (python imaging libs) in a
virtualenv
viapip
I get the following error:running egg_info writing Pillow.egg-info/PKG-INFO writing top-level names to Pillow.egg-info/top_level.txt writing dependency_links to Pillow.egg-info/dependency_links.txt warning: manifest_maker: standard file '-c' not found reading manifest file 'Pillow.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'Pillow.egg-info/SOURCES.txt' running build_ext building 'PIL._imaging' extension creating build/temp.linux-x86_64-2.7/libImaging x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -IlibImaging -I/usr/local/include -I/usr/include -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu -c _imaging.c -o build/temp.linux-x86_64-2.7/_imaging.o _imaging.c:76:20: fatal error: Python.h: No such file or directory #include "Python.h" ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I have installed all dependencies for Pillow, based on my experience with Wheezy, but it seems something is different with testing.
Any suggestions?
EDIT
In fact I discovered another problem with libc6. The version I had was from experimental. After downgrading it to testing's version, I reinstalled all dependencies but now I get a different error:
building 'PIL._imagingft' extension x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/freetype2 -IlibImaging -I/usr/include/tcl8.5 -I/usr/local/include -I/usr/include -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu -c _imagingft.c -o build/temp.linux-x86_64-2.7/_imagingft.o _imagingft.c:62:31: fatal error: freetype/fterrors.h: No such file or directory #include <freetype/fterrors.h> ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
It seems the experimental version of
libc6
messed things up, but I can't figure out what's wrong. Aptitude doesn't show any unmet dependencies andaptitude install -f
does nothing.Also, if indeed the linux-headers are relevant, the ones I have installed are:
linux-headers-3.11-2-all
linux-headers-3.11-2-all-amd64
linux-headers-3.11-2-amd64
linux-headers-3.11-2-common
linux-headers-3.2.0-4-amd64
linux-headers-3.2.0-4-common
linux-headers-amd64
-
Ludwig Schulze over 10 yearsDid you installed the kernel headers (the error seems that it's related, somehow).
-
Dennis Kaarsemaker over 10 yearsLinux headers are irrelevant, it's python headers that are missing.
-
alxs over 10 yearsAlready tried that. In fact I can normally install
python-imaging
system-wide withaptitude
, though I did not try to actually use it. -
Dennis Kaarsemaker over 10 yearsinteresting. What's the output of that command?
-
Matt Parrilla about 9 yearsthis worked for me in Ubuntu 14.04