Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named ryu.lib.packet #655

Open
zfloat opened this issue Mar 27, 2023 · 9 comments
Open

ImportError: No module named ryu.lib.packet #655

zfloat opened this issue Mar 27, 2023 · 9 comments

Comments

@zfloat
Copy link

zfloat commented Mar 27, 2023

I am now able to use French for simple network orchestration, but I still generate errors when compiling the learning. py file. Could you please help me solve this problem?

图片

@jnfoster
Copy link
Member

I think you want frenetic.examples.repeater.

@zfloat zfloat changed the title /usr/bin/python: No module named example ImportError: No module named ryu.lib.packet Apr 5, 2023
@zfloat
Copy link
Author

zfloat commented Apr 5, 2023

I am now able to use French for simple network orchestration, but I still generate errors when compiling the learning. py file. Could you please help me solve this problem?

图片

@jnfoster
Copy link
Member

jnfoster commented Apr 5, 2023

Oops.

Install Ryu like this,

pip install ryu

and then try again?

@zfloat
Copy link
Author

zfloat commented Apr 6, 2023

I have tried installing ryu using the code pip install ryu, but an error occurred during the installation process, as shown in the following figure.
图片
This may mean that installing ryu requires Python 3, so in the end, I had to use pip3 to install ryu. Although ryu was successfully installed, errors will still be reported when compiling the learning. py file with Python 2.
I'm at a loss what to do next.

@jnfoster
Copy link
Member

jnfoster commented Apr 6, 2023

I think you need to use the version of Ryu with Python 2.7.

Maybe try the from-source instructions here?
https://osrg.github.io/ryu-book/en/html/installation_guide.html

@zfloat
Copy link
Author

zfloat commented Apr 25, 2023

I have successfully solved the above problem by installing version 2.14.0 of Ovs before installing ryu. This is because the latest version of Ovs will generate errors when installed in the Python 2 environment.

Recently, I have been following the guide manual to further learn and use frenetic, but I have encountered errors when compiling the vlan2. py file. How can I solve this problem?
The following is my experimental process.
Copy the network_information_base_dynamic.py, network_information_base_static.py, and vlan2.py files into the examples folder.
frenetic http-controller --verbosity debug
sudo python2 mn_custom_topo.py
python2 -m frenetic.examples.vlan2

At this point, compilation generates the following error.
图片

@jnfoster
Copy link
Member

I assume this is from Chapter 5 of the manual. Can you share the content of mn_custom_topo.py?

@zfloat
Copy link
Author

zfloat commented Apr 26, 2023

Yes, this is indeed the content of Chapter 5 of the manual. The mn_custom_topo.py file was also obtained from https://github.com/frenetic-lang/manual/blob/master/programmers_guide/code/handling_vlans/mn_custom_topo.py

After I run this topology file, the following information is displayed.
sudo python2 mn_custom_topo.py
图片

@jnfoster
Copy link
Member

This seems to be a bug with the way VLAN'd packets are being created. I'm afraid I don't have the cycles to debug it now. I mention that in case you want to dig in. The Python code should create packets on the right VLAN. But apparently it's not. You could use TCPdump or Wireshark to see what packets are hitting the wire, and then debug from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants