Gcc error trying to install PIL in Python2.6 virtual file

I created virtualenv with the -no-site-packages option. I get an error trying to set PIL:

http://pastebin.com/SVqxs1sC

... error: command '/usr/bin/gcc' failed with exit status 1 ---------------------------------------- Command /home/dustin/.virtualenvs/django1.2/bin/python -c "import setuptools; __file__='/home/dustin/.virtualenvs/django1.2/build/pil/setup.py'; execfile('/home/dustin/.virtualenvs/django1.2/build/pil/setup.py')" install --single-version-externally-managed --record /tmp/pip-t_oikl-record/install-record.txt --install-headers /home/dustin/.virtualenvs/django1.2/include/site/python2.6 failed with error code 1 Exception information: Traceback (most recent call last): File "/home/dustin/.virtualenvs/django1.2/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg/pip/basecommand.py", line 120, in main self.run(options, args) File "/home/dustin/.virtualenvs/django1.2/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg/pip/commands/install.py", line 165, in run requirement_set.install(install_options) File "/home/dustin/.virtualenvs/django1.2/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg/pip/req.py", line 1243, in install requirement.install(install_options) File "/home/dustin/.virtualenvs/django1.2/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg/pip/req.py", line 540, in install cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False) File "/home/dustin/.virtualenvs/django1.2/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg/pip/__init__.py", line 226, in call_subprocess % (command_desc, proc.returncode)) InstallationError: Command /home/dustin/.virtualenvs/django1.2/bin/python -c "import setuptools; __file__='/home/dustin/.virtualenvs/django1.2/build/pil/setup.py'; execfile('/home/dustin/.virtualenvs/django1.2/build/pil/setup.py')" install --single-version-externally-managed --record /tmp/pip-t_oikl-record/install-record.txt --install-headers /home/dustin/.virtualenvs/django1.2/include/site/python2.6 failed with error code 1 

Can someone help me?

I am running Ubuntu 10.04 (64 bit)

+42
gcc python virtualenv python-imaging-library
Jun 03 2018-10-06T00:
source share
3 answers

You need to install the python-dev package.

 sudo apt-get install python-dev 
+81
Jun 03 '10 at 15:47
source share

Looking for a complete list of links to your pastebin, line

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

- a problem.

Gcc command line has

 -I/usr/include/python2.6 

where it would be expected to find it and what where it is in my Mandriva system.

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

+3
Jun 03 '10 at 15:45
source share

sudo apt-get install python-dev is very good, but if you use multiple pythons on your host system, and python2.6 is the default.

If you try:

  virtualenv -p python2.7 

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

 pip install PIL 

You will get this error: _imaging.c: 75: 20: error: Python.h: There is no such file or directory

You have to say !:

 sudo apt-get install python2.7-dev 
0
Nov 29 '13 at 11:53
source share



All Articles