x86_64上的gevent安装失败:“undefined symbol:evhttp_accept_socket”

时间:2010-05-17 14:41:13

标签: python libevent gevent

我正在尝试在新的EC2 CentOS 5.3 64位系统上安装gevent

由于yum中可用的libevent版本对于另一个包(beanstalkd)而言太旧了,我使用以下命令手动编译/安装libevent-1.4.13-stable

./configure --prefix=/usr && make && make install

这是安装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

我在本地VirtualBox实例(32位)上执行了完全相同的步骤,但我没有看到任何错误。

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:3)

最简单的修复方法是克隆git repository,切换到wip-all分支,然后运行python setup.py build_libevent build install抓取&amp;静静地构建对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

更多信息here