• ryu No module named


    [root@kunpeng82 sdx-ryu]# ryu-manager ctrl/asdx.py 
    loading app ctrl/asdx.py
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/ryu/utils.py", line 99, in import_module
        return _import_module_file(modname)
      File "/usr/local/lib/python3.6/site-packages/ryu/utils.py", line 88, in _import_module_file
        return load_source(modname, abspath)
      File "/usr/local/lib/python3.6/site-packages/ryu/utils.py", line 42, in load_source
        return loader.load_module(name)
      File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
      File "<frozen importlib._bootstrap_external>", line 823, in load_module
      File "<frozen importlib._bootstrap_external>", line 682, in load_module
      File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
      File "<frozen importlib._bootstrap>", line 684, in _load
      File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 674, in exec_module
      File "<frozen importlib._bootstrap_external>", line 781, in get_code
      File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/root/ryu/sdx-ryu/ctrl/asdx.py", line 270
        if (cookie <> 0):
                    ^
    SyntaxError: invalid syntax
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/local/bin/ryu-manager", line 11, in <module>
        load_entry_point('ryu==4.34', 'console_scripts', 'ryu-manager')()
      File "/usr/local/lib/python3.6/site-packages/ryu/cmd/manager.py", line 98, in main
        app_mgr.load_apps(app_lists)
      File "/usr/local/lib/python3.6/site-packages/ryu/base/app_manager.py", line 415, in load_apps
        cls = self.load_app(app_cls_name)
      File "/usr/local/lib/python3.6/site-packages/ryu/base/app_manager.py", line 392, in load_app
        mod = utils.import_module(name)
      File "/usr/local/lib/python3.6/site-packages/ryu/utils.py", line 104, in import_module
        return importlib.import_module(modname)
      File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 994, in _gcd_import
      File "<frozen importlib._bootstrap>", line 971, in _find_and_load
      File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "<frozen importlib._bootstrap>", line 994, in _gcd_import
      File "<frozen importlib._bootstrap>", line 971, in _find_and_load
      File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
    ModuleNotFoundError: No module named 'ctrl/asdx'
    [root@kunpeng82 sdx-ryu]#
    

      

    [root@kunpeng82 sdx-ryu]# export PYTHONPATH=/root/ryu/sdx-ryu/ctrl:$PYTHONPATH
    [root@kunpeng82 sdx-ryu]# ls
    ctrl  examples  README.md  ryu  setup  Vagrantfile  xrs
    [root@kunpeng82 sdx-ryu]# ryu-manager ./ctrl/asdx.py 
    loading app ./ctrl/asdx.py
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/ryu/utils.py", line 99, in import_module
        return _import_module_file(modname)
      File "/usr/local/lib/python3.6/site-packages/ryu/utils.py", line 88, in _import_module_file
        return load_source(modname, abspath)
      File "/usr/local/lib/python3.6/site-packages/ryu/utils.py", line 42, in load_source
        return loader.load_module(name)
      File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
      File "<frozen importlib._bootstrap_external>", line 823, in load_module
      File "<frozen importlib._bootstrap_external>", line 682, in load_module
      File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
      File "<frozen importlib._bootstrap>", line 684, in _load
      File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 674, in exec_module
      File "<frozen importlib._bootstrap_external>", line 781, in get_code
      File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/root/ryu/sdx-ryu/ctrl/asdx.py", line 270
        if (cookie <> 0):
                    ^
    SyntaxError: invalid syntax
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/local/bin/ryu-manager", line 11, in <module>
        load_entry_point('ryu==4.34', 'console_scripts', 'ryu-manager')()
      File "/usr/local/lib/python3.6/site-packages/ryu/cmd/manager.py", line 98, in main
        app_mgr.load_apps(app_lists)
      File "/usr/local/lib/python3.6/site-packages/ryu/base/app_manager.py", line 415, in load_apps
        cls = self.load_app(app_cls_name)
      File "/usr/local/lib/python3.6/site-packages/ryu/base/app_manager.py", line 392, in load_app
        mod = utils.import_module(name)
      File "/usr/local/lib/python3.6/site-packages/ryu/utils.py", line 104, in import_module
        return importlib.import_module(modname)
      File "/usr/lib64/python3.6/importlib/__init__.py", line 121, in import_module
        raise TypeError(msg.format(name))
    TypeError: the 'package' argument is required to perform a relative import for './ctrl/asdx.py'
    [root@kunpeng82 sdx-ryu]# ls ctrl/asdx.py 
    ctrl/asdx.py
    [root@kunpeng82 sdx-ryu]# 
    [root@kunpeng82 sdx-ryu]# export PYTHONPATH=/root/ryu/sdx-ryu/ctrl:$PYTHONPATH
    [root@kunpeng82 sdx-ryu]# ryu-manager asdx.py
    1134   export PYTHONPATH=/root/ryu/sdx-ryu/ctrl:$PYTHONPATH
     1135  ryu-manager /root/ryu/sdx-ryu/ctrl/asdx.py 
  • 相关阅读:
    901Air724UG模块(4G全网通GPRS开发)Air724UG(4G)使用SPI控制CH395Q(以太网模块)实现TCP/IP通信
    02STM32+MN316(NBIOT)基本控制篇(自建MQTT服务器)硬件使用说明
    Docker 清理none镜像 Prune命令
    Leetcode 252. 会议室 253. 会议室II 贪心算法扫描线技巧
    Leetcode 77. 组合(中等)回溯算法
    Leetcode 787. K 站中转内最便宜的航班(中等) 动态规划
    Leetcode 174. 地下城游戏(困难) 动态规划
    Linux arm环境下pip3安装av失败
    Leetcode 134. 加油站(中等) 贪心算法
    Leetcode 698. 划分为k个相等的子集(中等) 回溯算法=集合划分
  • 原文地址:https://www.cnblogs.com/dream397/p/13288220.html
Copyright © 2020-2023  润新知