1

我正在尝试在全新的 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 位)上执行了完全相同的步骤,但没有看到任何错误。

我将如何解决这个问题?

4

1 回答 1

3

最简单的解决方法是克隆git 存储库,切换到wip-all分支,然后运行python setup.py build_libevent build install它针对 gevent 静态抓取和构建 libevent:

# 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

更多信息在这里

于 2010-05-18T09:28:49.240 回答