天天看點

【python】Mininet+ryu錯誤:Import Error: cannot import name poll

在同一python interpreter中分别執行ryuapp和mininet時沒有問題,但當在ryuapp中内嵌使用Mininet時,會報如下錯誤:

......
File "build/bdist.linux-x86_64/egg/mininet/util.py", line 7, in 
ImportError: cannot import name poll
           

經過一番查找找到了遇到同樣問題的人:

mininet - Import Error: cannot import name poll - Stack Overflow

ImportError: cannot import name poll · Issue #1 · OpenState-SDN/spider

按照github上的回答,降級eventlet庫可以解決問題,但報錯:

ERROR: ryu 4.31 has requirement eventlet!=0.18.3,!=0.20.1,!=0.21.0,!=0.23.0,>=0.18.2, but you'll have eventlet 0.17.4 which is incompatible.
           

按照提示,嘗試了幾個版本,最後成功解決問題:

pip install -I eventlet==0.18.4
pip install eventlet==0.18.4
           
下一篇: 什麼是Ryu