Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在x86_64上安装gevent失败:“;未定义符号:evhttp“U接受”U插座;_Python_Libevent_Gevent - Fatal编程技术网

Python 在x86_64上安装gevent失败:“;未定义符号:evhttp“U接受”U插座;

Python 在x86_64上安装gevent失败:“;未定义符号:evhttp“U接受”U插座;,python,libevent,gevent,Python,Libevent,Gevent,我正在尝试在新的EC2 CentOS 5.364位系统上安装 由于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

我正在尝试在新的EC2 CentOS 5.364位系统上安装

由于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
[gevent-0.12.2]#python setup.py build--libevent/usr/lib
使用libevent 1.4.13-stable:libevent.so
运行构建
运行build\u py
运行build_ext
将/usr/src/gevent-0.12.2/build/lib.linux-x86_64-2.6/gevent/core.so链接到
/usr/src/gevent-0.12.2/gevent/core.so
[gevent-0.12.2]#cd/path/to/my/project
[项目]#python myscript.py
回溯(最近一次呼叫最后一次):
文件“myscript.py”,第9行,在
从gevent.wsgi将WSGIServer作为GeventServer导入
文件“/usr/lib/python2.6/site packages/gevent/_init__.py”,第32行,在
从gevent.core导入reinit
ImportError:/usr/lib/python2.6/site-packages/gevent/core.so:未定义的符号:evhttp\u accept\u socket
我在本地VirtualBox实例(32位)上执行了完全相同的步骤,没有发现任何错误


如何修复此问题?

最简单的修复方法是克隆,切换到
wip all
分支,然后运行
python setup.py build\u 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
更多信息