faucetsdn / ryu

Ryu component-based software defined networking framework

Home Page:https://ryu-sdn.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ryu-manager crash on Ubuntu 22.04 (Python3.10.4)

paaguti opened this issue · comments

Installed ryu on Ubuntu22.04. Trying to run the simple-switch-13 application:

student@uc3m:~$ ryu-manager ryu.app.simple_switch_13
Traceback (most recent call last):
  File "/home/student/.local/bin/ryu-manager", line 5, in <module>
    from ryu.cmd.manager import main
  File "/home/student/.local/lib/python3.10/site-packages/ryu/cmd/manager.py", line 33, in <module>
    from ryu.app import wsgi
  File "/home/student/.local/lib/python3.10/site-packages/ryu/app/wsgi.py", line 109, in <module>
    class _AlreadyHandledResponse(Response):
  File "/home/student/.local/lib/python3.10/site-packages/ryu/app/wsgi.py", line 111, in _AlreadyHandledResponse
    from eventlet.wsgi import ALREADY_HANDLED
ImportError: cannot import name 'ALREADY_HANDLED' from 'eventlet.wsgi' (/home/student/.local/lib/python3.10/site-packages/eventlet/wsgi.py)
student@uc3m:~$ python3 --version
Python 3.10.4```

Another crash:

student@mininet:~/Install/ryu$ ryu-manager ryu.app.simple_switch_13
Traceback (most recent call last):
  File "/home/student/.local/bin/ryu-manager", line 5, in <module>
    from ryu.cmd.manager import main
  File "/home/student/.local/lib/python3.10/site-packages/ryu/cmd/manager.py", line 22, in <module>
    from ryu.lib import hub
  File "/home/student/.local/lib/python3.10/site-packages/ryu/lib/hub.py", line 30, in <module>
    import eventlet
  File "/home/student/.local/lib/python3.10/site-packages/eventlet/__init__.py", line 17, in <module>
    from eventlet import convenience
  File "/home/student/.local/lib/python3.10/site-packages/eventlet/convenience.py", line 7, in <module>
    from eventlet.green import socket
  File "/home/student/.local/lib/python3.10/site-packages/eventlet/green/socket.py", line 4, in <module>
    __import__('eventlet.green._socket_nodns')
  File "/home/student/.local/lib/python3.10/site-packages/eventlet/green/_socket_nodns.py", line 11, in <module>
    from eventlet import greenio
  File "/home/student/.local/lib/python3.10/site-packages/eventlet/greenio/__init__.py", line 3, in <module>
    from eventlet.greenio.base import *  # noqa
  File "/home/student/.local/lib/python3.10/site-packages/eventlet/greenio/base.py", line 32, in <module>
    socket_timeout = eventlet.timeout.wrap_is_timeout(socket.timeout)
  File "/home/student/.local/lib/python3.10/site-packages/eventlet/timeout.py", line 166, in wrap_is_timeout
    base.is_timeout = property(lambda _: True)
TypeError: cannot set 'is_timeout' attribute of immutable type 'TimeoutError'

after fixing with the requirements generated on a working Ryu on Ubuntu 20.04

It's because this project not support for python 3.10, use python 3.9 or previous version may be useful, in my ubuntu I choose install anaconda to manager multi python version.

@paaguti i saw you created a PR to a fork with this working in 22.04. i followed your instructions but it's still not working (different error related to module 'collections'). any suggestions to make this continue to work?

ah, possibly just need to add dnspython==2.2.1 to pip-requires

Here's how I got it working:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get install virtualenv python3.9 python3.9-distutils

#create the virtualenv 
virtualenv -p`which python3.9` ryu-python3.9-venv
source ryu-python3.9-venv/bin/activate
echo $VIRTUAL_ENV #check if we are indeed in the virtual environment
pip install ryu
pip uninstall eventlet
pip install eventlet==0.30.2
ryu-manager --help
commented

My fork now works with Python3.10+

On Sun, 7 May 2023 at 15:16, Joseph Anthony C. Hermocilla < @.> wrote: Here's how I got it working: sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get install virtualenv python3.9 #create the virtualenv virtualenv -pwhich python3.9 ryu-python3.9-venv source ryu-python3.9-venv/bin/activate echo $VIRTUAL_ENV #check if we are indeed in the virtual environment pip install ryu pip uninstall eventlet pip install eventlet==0.30.2 ryu-manager --help — Reply to this email directly, view it on GitHub <#169 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZKU4BJTTCPAAHP2FR53UDXE6OBRANCNFSM5X4Z23UQ . You are receiving this because you were mentioned.Message ID: @.>
-- Fragen sind nicht da, um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler Headaches with a Juju log: unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run a leader-deposed hook here, but we can't yet

how did you got it working? are you following the @jachermocilla steps or any other ways?

So I guess the PR won't be merged until a new maintainer is found?

commented

My fork now works with Python3.10+

On Sun, 7 May 2023 at 15:16, Joseph Anthony C. Hermocilla < @.> wrote: Here's how I got it working: sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get install virtualenv python3.9 #create the virtualenv virtualenv -pwhich python3.9 ryu-python3.9-venv source ryu-python3.9-venv/bin/activate echo $VIRTUAL_ENV #check if we are indeed in the virtual environment pip install ryu pip uninstall eventlet pip install eventlet==0.30.2 ryu-manager --help — Reply to this email directly, view it on GitHub <#169 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZKU4BJTTCPAAHP2FR53UDXE6OBRANCNFSM5X4Z23UQ . You are receiving this because you were mentioned.Message ID: @.>
-- Fragen sind nicht da, um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler Headaches with a Juju log: unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run a leader-deposed hook here, but we can't yet

hey Paaguti! I just tried out the latest Ryu, but seems another error appears. I wonder if you familiar with this error when testing ryu?

defcon@defcon-Parallels-ARM-Virtual-Machine:~/ryu$ ryu-manager ryu.app.simple_switch
Traceback (most recent call last):
File "/usr/local/bin/ryu-manager", line 33, in
sys.exit(load_entry_point('ryu==4.34', 'console_scripts', 'ryu-manager')())
File "/usr/local/bin/ryu-manager", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.10/importlib/metadata/init.py", line 171, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/defcon/.local/lib/python3.10/site-packages/ryu/cmd/manager.py", line 22, in
from ryu.lib import hub
File "/home/defcon/.local/lib/python3.10/site-packages/ryu/lib/hub.py", line 30, in
import eventlet
File "/home/defcon/.local/lib/python3.10/site-packages/eventlet/init.py", line 17, in
from eventlet import convenience
File "/home/defcon/.local/lib/python3.10/site-packages/eventlet/convenience.py", line 7, in
from eventlet.green import socket
File "/home/defcon/.local/lib/python3.10/site-packages/eventlet/green/socket.py", line 21, in
from eventlet.support import greendns
File "/home/defcon/.local/lib/python3.10/site-packages/eventlet/support/greendns.py", line 79, in
setattr(dns, pkg, import_patched('dns.' + pkg))
File "/home/defcon/.local/lib/python3.10/site-packages/eventlet/support/greendns.py", line 61, in import_patched
return patcher.import_patched(module_name, **modules)
File "/home/defcon/.local/lib/python3.10/site-packages/eventlet/patcher.py", line 132, in import_patched
return inject(
File "/home/defcon/.local/lib/python3.10/site-packages/eventlet/patcher.py", line 109, in inject
module = import(module_name, {}, {}, module_name.split('.')[:-1])
File "/usr/local/lib/python3.10/dist-packages/dns/namedict.py", line 35, in
class NameDict(collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'

it helped thanks