views:

326

answers:

2

I have created a virtualenv with the --no-site-packages option. I get an error trying to install 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 with this?

I'm running Ubuntu 10.04 (64 bit)

A: 

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?

Troubadour
+5  A: 

You need to install python-dev package.

sudo apt-get install python-dev
dzen