2013-07-05 26 views
20

ローカルフォルダのPyladies Webサイトで作業しようとしていました。私はレポをクローンしました、(https://github.com/pyladies/pyladies)!仮想環境を作成しました。私はピップを行うときしかし、-r要件をインストールし、私はこれをやってみましたgevent/libevent.h:9:19:致命的なエラー:event.h:そのようなファイルまたはディレクトリがありません

Installing collected packages: gevent, greenlet 
Running setup.py install for gevent 
building 'gevent.core' extension 
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -I/opt/local/include -fPIC -I/usr/include/python2.7 -c gevent/core.c -o build/temp.linux-i686-2.7/gevent/core.o 
In file included from gevent/core.c:253:0: 
gevent/libevent.h:9:19: fatal error: event.h: No such file or directory 
compilation terminated. 
error: command 'gcc' failed with exit status 1 
Complete output from command /home/akoppad/virt/pyladies/bin/python -c "import setuptools;__file__='/home/akoppad/virt/pyladies/build/gevent/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-4MSIGy-record/install-record.txt --install-headers /home/akoppad/virt/pyladies/include/site/python2.7: 
running install 

running build 

running build_py 

running build_ext 

building 'gevent.core' extension 

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -I/opt/local/include -fPIC -I/usr/include/python2.7 -c gevent/core.c -o build/temp.linux-i686-2.7/gevent/core.o 

In file included from gevent/core.c:253:0: 

gevent/libevent.h:9:19: fatal error: event.h: No such file or directory 

compilation terminated. 

error: command 'gcc' failed with exit status 1 

---------------------------------------- 
Command /home/akoppad/virt/pyladies/bin/python -c "import setuptools;__file__='/home/akoppad/virt/pyladies/build/gevent/setup.py'; exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-4MSIGy-record/install-record.txt --install-headers /home/akoppad/virt/pyladies/include/site/python2.7 failed with error code 1 in /home/akoppad/virt/pyladies/build/gevent 
Storing complete log in /home/akoppad/.pip/pip.log. 

このエラーを取得しています、 sudoのポート」libevent CFLAGSを=をインストールする - 私は/ opt /ローカル/含ま-Lは/ opt/local/lib "pip install gevent

ポートコマンドが見つかりません。

これを進める方法がわかりません。ありがとう!

答えて

51

私は同じ問題を抱えていました。他の答えが示すように、私は "libevent"をインストールしなければなりませんでした。これは明らかに、もはや「libevent-develの」と呼ばれていない(apt-getのそれを見つけることができませんでした)が、やって:

$ apt-cache search libevent 

は、利用可能なパッケージの束を記載されています。

$ apt-get install libevent-dev 

私のために働いた。

pip install Flask-Sockets 

sudo apt-get install libevent-dev 

にしようとしているときに、私はこの問題を持っていた

+0

も私のために働いた(Ubuntu) – swietyy

+0

パーフェクト!それは単に揺さぶられました:) – softvar

+0

この解決方法は正しいものではなく、他のものと同じマークを付けてください –

11

私は環境に「libevent」をインストールすることを忘れていると思います。 OSXマシンを使用している場合は、ここにbrewをインストールしてください。http://mxcl.github.io/homebrew/ brew install libeventを使用して依存関係をインストールしてください。 ubuntuマシンを使用している場合、apt-getを実行して対応するライブラリをインストールすることができます。

+0

ありがとうございました。私はsudoをしようとしていました - 仮想環境の中にlibevent-develをインストールしてください。したがって、エラー。私はそれを通常仮想環境の外にインストールし、通常の方法でインストールしました。もう一度ありがとう! –

2

は、私はCentOSの上ですので、このコマンドは、私の作品私のため

1
yum install libevent-* 

を働きました。

1

ピップインストールを実行しているMacOS 10.10.1(Yosemite)でこのエラーが発生しました。私の解決策は、pipが欠けていたlibeventへのパスを追加することでした。これらはCファイルで、CFLAGSとDFLAGSはblu環境変数で、pipにこれらのファイルの場所を知らせます。私のシステムでは、libeventは/ usr/local/include/event2にあります。

$ CFLAGS=-I/usr/local/include/event2 DFLAGS=-L/usr/local/lib pip install -r requires.txt 
関連する問題