Hi Brad, Thank you for your reporting!
Yes, as you said, ryu.utils.import_module() prefers to loading a Python module than file paths. In order to solve this problem, we need to change the priority (Python module or file path), I guess. You mean "file path should be preferred", right? Thanks, Iwase On 2017年03月19日 11:05, Brad Cowie wrote: > Hi there, > > If you have a RyuApp and put it in a python file that happens to have the > same name as any python module installed in PYTHON_PATH, ryu-manager will be > unable to load the RyuApp. > > Here is an example showing the issue in ryu-manager 4.12: > > brad@zilch ~/D/r/r/app> ryu-manager ./simple_switch_13.py > loading app ./simple_switch_13.py > loading app ryu.controller.ofp_handler > instantiating app ./simple_switch_13.py of SimpleSwitch13 > instantiating app ryu.controller.ofp_handler of OFPHandler > [loads fine] > > brad@zilch ~/D/r/r/app> pip freeze | grep six > six==1.10.0 > [find name of any package installed with pip] > > > > brad@zilch ~/D/r/r/app> mv ./simple_switch_14.py ./six.py > brad@zilch ~/D/r/r/app> ryu-manager ./six.py > loading app ./six.py > [ryu-manager will attempt to load a RyuApp from > /usr/lib/python2.7/dist-packages/six.py instead of ./six.py] > > This seems to be an issue in ryu > <https://github.com/osrg/ryu/tree/master/ryu>/*utils.py* where > import_module() will prefer to load a python module even when presented with > a relative or absolute file path. > > Interested on people's thoughts on the best way to solve this one. > > Regards, > Brad > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > > _______________________________________________ > Ryu-devel mailing list > Ryu-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/ryu-devel > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel