I'm trying to install gevent on a fresh EC2 CentOS 5.3 64-bit system.
Since the libevent version available in yum was too old for another package (beanstalkd) I compiled/installed libevent-1.4.13-stable
manually using the following command:
./configure --prefix=/usr && make && make install
This is the output from installing gevent:
[gevent-0.12.2]# python setup.py build --libevent /usr/lib
Using libevent 1.4.13-stable: libevent.so
running build
running build_py
running build_ext
Linking /usr/src/gevent-0.12.2/build/lib.linux-x86_64-2.6/gevent/core.so to
/usr/src/gevent-0.12.2/gevent/core.so
[开发者_运维知识库gevent-0.12.2]# cd /path/to/my/project
[project]# python myscript.py
Traceback (most recent call last):
File "myscript.py", line 9, in <module>
from gevent.wsgi import WSGIServer as GeventServer
File "/usr/lib/python2.6/site-packages/gevent/__init__.py", line 32, in <module>
from gevent.core import reinit
ImportError: /usr/lib/python2.6/site-packages/gevent/core.so: undefined symbol: evhttp_accept_socket
I've followed exactly the same steps on a local VirtualBox instance (32-bit) and I'm not seeing any errors.
How would I fix this?
Easiest fix was to clone the git repository, switch to the wip-all
branch, and run python setup.py build_libevent build install
which grabs & builds libevent statically against gevent:
# git clone http://github.com/schmir/gevent.git
# cd gevent
# git branch -a
* upstream
origin/HEAD
origin/close-socket-cancel-event
origin/pywsgi-without-basehttpserver
origin/upstream
origin/wip-all
origin/wip-setup-config
# git checkout origin/wip-all
# python setup.py build_libevent build install
More information here.
精彩评论