我使用--no-site-packages選項創建了virtualenv。我得到一個錯誤試圖安裝PIL:嘗試在Python2.6虛擬環境中安裝PIL的gcc錯誤
...
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
有人可以幫助我?
我運行Ubuntu 10.04(64位)
我在一個Windows 7環境。我如何去安裝python-dev? – darren 2011-02-17 10:11:41
因爲virtualenv使用2.6,所以我不得不在我的情況下安裝'python2.6-dev'。如果你使用的是CentOS/RHEL,只需要爲其他人提供 – agscala 2011-06-04 14:59:07
'yum install python-devel'。 – Banjer 2012-06-20 19:33:31