エラー: イベントレットのインストール中にコマンド 'gcc' が終了ステータス 1 で失敗しました 質問する

エラー: イベントレットのインストール中にコマンド 'gcc' が終了ステータス 1 で失敗しました 質問する

eventletソフトウェアの展開用に「Herd」を使用するためにシステムにインストールしたかったのですが、ターミナルに gcc エラーが表示されています。

  root@agrover-OptiPlex-780:~# easy_install -U eventlet
  Searching for eventlet
  Reading http://pypi.python.org/simple/eventlet/
  Reading http://wiki.secondlife.com/wiki/Eventlet
  Reading http://eventlet.net
   Best match: eventlet 0.9.16
    Processing eventlet-0.9.16-py2.7.egg
    eventlet 0.9.16 is already the active version in easy-install.pth

   Using /usr/local/lib/python2.7/dist-packages/eventlet-0.9.16-py2.7.egg
 Processing dependencies for eventlet
 Searching for greenlet>=0.3
Reading http://pypi.python.org/simple/greenlet/
Reading https://github.com/python-greenlet/greenlet
Reading http://bitbucket.org/ambroff/greenlet
Best match: greenlet 0.3.4
Downloading http://pypi.python.org/packages/source/g/greenlet/greenlet-   0.3.4.zip#md5=530a69acebbb0d66eb5abd83523d8272
Processing greenlet-0.3.4.zip
Writing /tmp/easy_install-_aeHYm/greenlet-0.3.4/setup.cfg
Running greenlet-0.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_aeHYm/greenlet-0.3.4/egg-dist-tmp-t9_gbW
In file included from greenlet.c:5:0:
greenlet.h:8:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1`

なぜPython.h見つからないのでしょうか?

ベストアンサー1

Python 開発ヘッダーがインストールされていないため、インストールが失敗します。

まず、 でパッケージを更新しますsudo apt update

ubuntu/debian の apt 経由でこれを実行できます:

sudo apt-get install python-dev 

Python3の場合は以下を使用します:

sudo apt-get install python3-dev

eventletライブラリのインストールも必要になる可能性があるのでlibevent、そのエラーが発生した場合は、次のコマンドで libevent をインストールできます。

sudo apt-get install libevent-dev

おすすめ記事