gcc error trying to install PIL in a Python2.6 virtualenv gcc error trying to install PIL in a Python2.6 virtualenv python python

gcc error trying to install PIL in a Python2.6 virtualenv


You need to install python-dev package.

sudo apt-get install python-dev


Looking at the full listing on your pastebin link the line

_imaging.c:75:20: error: Python.h: No such file or directory

is the problem.

The gcc command line has

-I/usr/include/python2.6

there so that would be where it would expect to find it and that's where it is on my Mandriva system.

Perhaps you have python installed but not the development libraries which would be in the corresponding "-devel" version of the package?


sudo apt-get install python-dev - is very good, butif you use few pythons on your host system, and python2.6 is default.

If you try to:

 virtualenv -p python2.7

, go to the bin directory, say source activate,than:

pip install PIL

You get error like this: _imaging.c:75:20: error: Python.h: No such file or directory

You should say!:

sudo apt-get install python2.7-dev