42

--no-site-packages オプションを使用して virtualenv を作成しました。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

誰かがこれで私を助けることができますか?

Ubuntu 10.04 (64 ビット) を実行しています

4

3 に答える 3

80

python-dev パッケージをインストールする必要があります。

sudo apt-get install python-dev
于 2010-06-03T15:47:20.350 に答える
3

あなたのペーストビンの完全なリストを見て、行をリンクしてください

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

問題です。

gccコマンドラインには

-I/usr/include/python2.6

そこにそれが見つかると期待される場所であり、それが私のMandrivaシステム上にある場所です。

おそらく、Pythonはインストールされていますが、対応する「-devel」バージョンのパッケージに含まれる開発ライブラリはインストールされていませんか?

于 2010-06-03T15:45:03.313 に答える
0

sudo apt-get install python-dev - 非常に優れていますが、ホスト システムでほとんどの python を使用しておらず、python2.6 がデフォルトです。

あなたがしようとすると:

 virtualenv -p python2.7

、binディレクトリに移動し、ソースのアクティブ化と言います。

pip install PIL

次のようなエラーが発生します: _imaging.c:75:20: error: Python.h: No such file or directory

言うべき!:

sudo apt-get install python2.7-dev
于 2013-11-29T11:53:43.413 に答える