Очень кратко, долго искал решение такой проблемы. У меня несколько питонов установлено на Ubuntu 10.10.
Для python2.6 установлены sudo apt-get install python-dev.
А для второго, питона, который используется в virtualenv (python2.7) оно не было установлено.
Решение проблемы:
sudo apt-get install python2.7-dev
А затем:
Само собой вы не забыли сделать
source bin/activate
pip install Pillow
или
pip install PIL
А так была следующая ошибка
''' % pip install Pillow --download-cache distrib !4048 Downloading/unpacking Pillow Running setup.py egg_info for package Pillow
Installing collected packages: Pillow Running setup.py install for Pillow
building 'PIL._imaging' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -I/usr/include/freetype2 -IlibImaging -I/home/apalkov/PycharmProjects/dok4you/dok4you/include -I/usr/local/include -I/usr/include -I/usr/include/python2.7 -c _imaging.c -o build/temp.linux-x86_64-2.7/_imaging.o
_imaging.c:76: fatal error: Python.h: Нет такого файла или каталога
compilation terminated.
error: command 'gcc' failed with exit status 1
Complete output from command /home/apalkov/PycharmProjects/dok4you/dok4you/bin/python2.7 -c "import setuptools;__file__='/home/apalkov/PycharmProjects/dok4you/dok4you/build/Pillow/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-VPTaMy-record/install-record.txt --single-version-externally-managed --install-headers /home/apalkov/PycharmProjects/dok4you/dok4you/include/site/python2.7:
running install
running build
running build_py
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
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -I/usr/include/freetype2 -IlibImaging -I/home/apalkov/PycharmProjects/dok4you/dok4you/include -I/usr/local/include -I/usr/include -I/usr/include/python2.7 -c _imaging.c -o build/temp.linux-x86_64-2.7/_imaging.o
_imaging.c:76: fatal error: Python.h: Нет такого файла или каталога
compilation terminated.
error: command 'gcc' failed with exit status 1 '''