Python3中的Gevent支持 [英] Gevent support in Python3

查看:104
本文介绍了Python3中的Gevent支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在与Python2.7成功结合使用后,我试图在Python3.4中安装和使用Gevent.但是,使用Python 3时,导入本身出现错误.仍然在python3中不受支持吗?

I was trying to install and use Gevent in Python3.4 after successfully using it with Python2.7. However using Python 3 I am getting a error at import itself. Is it not supported still in python3?

使用gcc 4.9,并使用pip3 install gevent安装.

Using gcc 4.9 and installed using pip3 install gevent.

import gevent
  File "/usr/local/lib/python3.4/dist-packages/gevent/__init__.py", line 41, in <module>
    from gevent.hub import get_hub, iwait, wait
  File "/usr/local/lib/python3.4/dist-packages/gevent/hub.py", line 289
    except Exception, ex:

推荐答案

except Exception, ex是Python 2语法,在Python 3中应为except Exception as ex.看来Gevent软件包确实没有为Python 3正确准备.

except Exception, ex is Python 2 syntax, it should be except Exception as ex in Python 3. It looks like the Gevent package is indeed not properly prepared for Python 3.

这篇关于Python3中的Gevent支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆