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

p4run problem #68

Open
zwllwz823 opened this issue Dec 15, 2023 · 5 comments
Open

p4run problem #68

zwllwz823 opened this issue Dec 15, 2023 · 5 comments

Comments

@zwllwz823
Copy link

Hey everyone,
I just used copy my p4app.json to the p4run folder and use these commands:
p4run
sudo p4run
sudo p4run --config p4app.json
But all of these commands gives me the feedback:

Traceback (most recent call last):
File "/usr/local/bin/p4run", line 11, in
load_entry_point('p4utils', 'console_scripts', 'p4run')()
File "/home/zwl/p4-utils/p4utils/p4run.py", line 736, in main
app = AppRunner(args.config,
File "/home/zwl/p4-utils/p4utils/p4run.py", line 308, in init
mininet = load_custom_object(mininet_module)
File "/home/zwl/p4-utils/p4utils/utils/helper.py", line 321, in load_custom_object
module = importlib.import_module(module_name)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'p4utils.mininetlib.p4net'

I tried many ways but no one works.
I even uninstall p4utils and install again in my VM but it still goes wrong.
can anyone help me please...

@edgar-costa
Copy link
Collaborator

I believe its a problem with your installation and python installation.

Can you try import p4utils with python3?

@a5539322
Copy link

@edgar-costa hello I also encountered this problem, can you explain it in detail? I am a student, thank you very much

@a5539322
Copy link

Replenish:I installed it using the "install-p4-dev.sh" provided on this website. This picture is the situation I encountered. It is the same as this problem. I will encounter this problem when using all the sample programs on the Internet. , except the "examples" provided by p4utils itself can be executed, others cannot. Please help me solve this problem. I really need to use this to complete my studies. Thank you.
messageImage_1702932855316

@edgar-costa
Copy link
Collaborator

@a5539322 the problem you are showing in the screenshot has nothing to do with the thread.

Open a new issue. But in any case the problem is due to your code using the old version of p4-utils, p4net does not exist anymore. You will have to look at the new examples, there is plenty here: https://github.com/nsg-ethz/p4-learning/tree/master and translate your code so the imports work.

@a5539322
Copy link

@edgar-costa Thank you very much for your help. Now I understand the situation I encountered. I will try to solve this problem again. Since I am only a student, I may have a poor understanding of many things. If I really can't solve it, I will ask again. Really Thank you very much for your help

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

3 participants