20

ローカル フォルダーの Pyladies Web サイトで作業しようとしていました。レポを複製しました ( https://github.com/pyladies/pyladies ) ! そして仮想環境を作成しました。ただし、 pip install -r 要件を実行すると、このエラーが発生します

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 port install libevent CFLAGS="-I /opt/local/include -L /opt/local/lib" pip install gevent

ポートコマンドが見つかりませんと表示されます。

これをどのように進めればよいかわかりません。ありがとう!

4

5 に答える 5

11

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

于 2013-07-06T00:15:07.633 に答える
2

しようとしているときにこの問題が発生しました

pip install Flask-Sockets

sudo apt-get install libevent-dev

私のために働いた

于 2013-11-20T12:07:18.590 に答える
1
yum install libevent-* 

私は centos を使用しているため、このコマンドは機能します。

于 2014-09-03T17:01:09.783 に答える