nsg-ethz / p4-utils

Extension to Mininet that makes P4 networks easier to build
GNU General Public License v2.0
183 stars 67 forks source link

ModuleNotFoundError: No module named 'p4utils.mininetlib.p4net' #32

Closed ohnowade closed 2 years ago

ohnowade commented 2 years ago

Hi all,

My environment is Ubuntu 18.04 and my GCC version is 7.5. I have installed all the dependencies using the script provided and run install.sh. When I tired to start p4run, this error occurs.

Traceback (most recent call last): File "/usr/local/bin/p4run", line 11, in load_entry_point('p4utils', 'console_scripts', 'p4run')() File "/home/ubuntu/p4-utils/p4utils/p4run.py", line 739, in main verbosity=args.verbosity) File "/home/ubuntu/p4-utils/p4utils/p4run.py", line 308, in init mininet = load_custom_object(mininet_module) File "/home/ubuntu/p4-utils/p4utils/utils/helper.py", line 321, in load_custom_object module = importlib.import_module(module_name) File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 953, in _find_and_load_unlocked ModuleNotFoundError: No module named 'p4utils.mininetlib.p4net'

Does anyone know how to fix this?

Thank you so much!

edgar-costa commented 2 years ago

Does import p4utils work? Also, make sure you are using python3

Benature commented 2 years ago

Hi, I am using the preconfigured VM, encountered same problem image here import p4utils work, and python is version 3

edgar-costa commented 2 years ago

Which version of the VM are you using? Did you pull and got the latest p4utils?

p4net is an older module that does not exist anymore. It seems that you might have the old p4run installed with the newer code or something like that.

Try to git pull the repo and check if the problem disappears. Also you could try to install it again, see install.sh.

edgar-costa commented 2 years ago

I just tested with the provided VM, and the example at p4utils/examples/switches and it worked.

p4@ict-networks-010-000-002-015:~/p4-tools/p4-utils/examples/switches$ sudo p4run --config p4app.json
Benature commented 2 years ago

Sorry, my p4app.json is too old, updated p4app.json works with p4run