1:
在ryu中的app中导入一个新的包时,要先用python 将其中的py文件执行一遍,生成.pyc文件,否则直接
ryu-manager xx 文件.py会显示找不到包的错误,可能用python执行一遍的时候会自动记录新包的路径,否则直接ryu-manager,就会报错说找不到这个新导入的模块
2:
root@eb73808fd133:~/ryu/ryu/app# ryu-manager haha.py
loading app haha.py
Traceback (most recent call last):
File "/usr/local/bin/ryu-manager", line 9, in
load_entry_point('ryu==4.31', 'console_scripts', 'ryu-manager')()
File "/usr/local/lib/python2.7/dist-packages/ryu/cmd/manager.py", line 98, in main
app_mgr.load_apps(app_lists)
File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line 415, in load_apps
cls = self.load_app(app_cls_name)
File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py", line 392, in load_app
mod = utils.import_module(name)
File "/usr/local/lib/python2.7/dist-packages/ryu/utils.py", line 104, in import_module
return importlib.import_module(modname)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named haha.py 要先执行python haha.py
root@eb73808fd133:~/ryu/ryu/app#
root@eb73808fd133:~/ryu/ryu/app#
root@eb73808fd133:~/ryu/ryu/app#
root@eb73808fd133:~/ryu/ryu/app#
root@eb73808fd133:~/ryu/ryu/app#
root@eb73808fd133:~/ryu/ryu/app# python haha.py
File "haha.py", line 36
print(msg) 缩进问题
^
IndentationError: unexpected indent
root@eb73808fd133:~/ryu/ryu/app#
root@eb73808fd133:~/ryu/ryu/app#
3:
root@eb73808fd133:~/ryu/ryu/app# ryu-manager haha.py
loading app haha.py
loading app ryu.controller.ofp_handler
instantiating app haha.py of ARP_PROXY_13
instantiating app ryu.controller.ofp_handler of OFPHandler
hub: uncaught exception: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 60, in _launch
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/ryu/controller/controller.py", line 202, in server_loop
datapath_connection_factory)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 127, in __init__
self.server = eventlet.listen(listen_info)
File "/usr/lib/python2.7/dist-packages/eventlet/convenience.py", line 43, in listen
sock.bind(addr)
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use
hub: uncaught exception: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 60, in _launch
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/ryu/controller/controller.py", line 153, in __call__
self.ofp_ssl_listen_port)
File "/usr/local/lib/python2.7/dist-packages/ryu/controller/controller.py", line 202, in server_loop
datapath_connection_factory)
File "/usr/local/lib/python2.7/dist-packages/ryu/lib/hub.py", line 127, in __init__
self.server = eventlet.listen(listen_info)
File "/usr/lib/python2.7/dist-packages/eventlet/convenience.py", line 43, in listen
sock.bind(addr)
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use
root@eb73808fd133:~/ryu/ryu/app#
解决方法:root@eb73808fd133:~/ryu/ryu/app# ryu-manager --verbose haha.py gui_topology/gui_topology.py --observe-links
阅读(3292) | 评论(0) | 转发(0) |