Hi,
Well... on my environment, it works fine.
$ tree ryu/lib/third_party/
ryu/lib/third_party/
├── __init__.py
└── third_party_mod.py
$ cat ryu/lib/third_party/third_party_mod.py
message = 'This is a third party module'
$ git diff
diff --git a/ryu/app/simple_switch_13.py b/ryu/app/simple_switch_13.py
index 3e7c598..298a58b 100644
--- a/ryu/app/simple_switch_13.py
+++ b/ryu/app/simple_switch_13.py
@@ -21,6 +21,7 @@ from ryu.ofproto import ofproto_v1_3
from ryu.lib.packet import packet
from ryu.lib.packet import ethernet
from ryu.lib.packet import ether_types
+from ryu.lib.third_party import third_party_mod
class SimpleSwitch13(app_manager.RyuApp):
@@ -48,6 +49,8 @@ class SimpleSwitch13(app_manager.RyuApp):
ofproto.OFPCML_NO_BUFFER)]
self.add_flow(datapath, 0, match, actions)
+ self.logger.info('*** %s', third_party_mod.message)
+
def add_flow(self, datapath, priority, match, actions, buffer_id=None):
ofproto = datapath.ofproto
parser = datapath.ofproto_parser
$ sudo python setup.py install
...
$ sudo mn --topo single --mac --controller remote
...
$ ryu-manager ryu.app.simple_switch_13
loading app ryu.app.simple_switch_13
loading app ryu.controller.ofp_handler
instantiating app ryu.app.simple_switch_13 of SimpleSwitch13
instantiating app ryu.controller.ofp_handler of OFPHandler
*** This is a third party module
Thanks,
Iwase
On 2015年10月28日 23:27, Ezzat Zar wrote:
> Hi,
> Thanks for reply. No it doesn't have a setup script and placing it in ryu/lib
> folder also makes no difference
>
> On Wed, Oct 28, 2015 at 9:26 AM, Yusuke Iwase <[email protected]
> <mailto:[email protected]>> wrote:
>
> Hi,
>
> Does not the third party library provide setup.py or any installation
> method?
> If the library provides it, please install the library first.
>
> If not, how about placing the library folder into e.g. <ryu_root>/ryu/lib/
> and importing it as e.g. "from ryu.lib import utility_library"?
> Because ryu-manager referss to <ryu_root>/ryu as the top of the Ryu
> application.
> e.g.) "import ryu" means <ryu_root>/ryu
>
> Thanks,
> Iwase
>
>
> On 2015年10月27日 09:12, Ezzat Zar wrote:
> > Hi all,
> > I want to run a ryu application which in it's code has imported a
> utility python library, but ryu manager cannot find this library and returns
> ImportError: No module named...
> > I've tried placing library folder everywhere in Ryu folder but this
> doesn't seem to work. How can I fix this? In fact how can I introduce a path
> to Ryu-manager to search into that path too?
> >
> > Thanks.
> >
> >
> >
> ------------------------------------------------------------------------------
> >
> >
> >
> > _______________________________________________
> > Ryu-devel mailing list
> > [email protected] <mailto:[email protected]>
> > https://lists.sourceforge.net/lists/listinfo/ryu-devel
> >
>
>
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel