Loading

ubuntu使用gevent报ImportError: No module named zope.interface解决

 

在ubuntu上用pip install grequest安装后,使用的时候发现总是gevent.py报ImportError: No module named zope.interface的错误

File "/usr/local/lib/python2.7/dist-packages/gevent/monkey.py", line 192, in ignores
    from gevent.events import DoNotPatch
  File "/usr/local/lib/python2.7/dist-packages/gevent/events.py", line 67, in <module>
    from zope.interface import Interface
ImportError: No module named interface

 

因为pip安装grequest时也会会安装gevent,zope.interface等,查了原因发现pip安装的路径下,没有此interface,但系统路径下有,所以可以软连接过去

cd /usr/local/lib/python2.7/dist-packages/zope
ln -s /usr/lib/python2.7/dist-packages/zope/interface/

 

posted @ 2020-07-23 13:42  fengf233  阅读(1332)  评论(0编辑  收藏  举报