. /mycontroller.py ModuleNotFoundError: No module named 'p4.tmp'
While doing the p4runtime in tutorials to execute . /mycontroller.py in the tutorials.
Traceback (most recent call last).
File ". /mycontroller.py", line 14, in <module
import p4runtime_lib.bmv2
File "/root/P4/tutorials/exercises/p4runtime/... /... /utils/p4runtime_lib/bmv2.py", line 15, in <module>
from p4.tmp import p4config_pb2
ModuleNotFoundError: No module named 'p4.tmp'
I followed the #463 but it didn't work.
And while execute locate p4config_pb2 I was getting:
/root/P4/PI/proto/py_out/p4/tmp/p4config_pb2.py
/root/P4/PI/proto/py_out/p4/tmp/p4config_pb2_grpc.py
/root/P4/tutorials/utils/p4/tmp/p4config_pb2.py
/root/P4/tutorials/utils/p4/tmp/p4config_pb2_grpc.py
/root/P4/tutorials/utils/p4/tmp/__pycache__/p4config_pb2.cpython-38.pyc
/root/P4/tutorials/utils/p4/tmp/__pycache__/p4config_pb2_grpc.cpython-38.pyc
/usr/local/lib/python3.8/site-packages/p4/tmp/p4config_pb2.py
/usr/local/lib/python3.8/site-packages/p4/tmp/p4config_pb2_grpc.py
/usr/local/lib/python3.8/site-packages/p4/tmp/__pycache__/p4config_pb2.cpython-38.opt-1.pyc
/usr/local/lib/python3.8/site-packages/p4/tmp/__pycache__/p4config_pb2.cpython-38.pyc
/usr/local/lib/python3.8/site-packages/p4/tmp/__pycache__/p4config_pb2_grpc.cpython-38.opt-1.pyc
/usr/local/lib/python3.8/site-packages/p4/tmp/__pycache__/p4config_pb2_grpc.cpython-38.pyc
It seems so normal that I can't find any other solution. HELP!!!
There are only a few ways to install the open source P4 development tools so that they all work together to run these tutorials. There are thousands of variations on those that do not quite work.
If you have used one of the two methods described on this page https://github.com/jafingerhut/p4-guide/blob/master/bin/README-install-troubleshooting.md then those are some of the few ways I have personally tested to work.
If you have used any other way to install open source P4 development tools, then I do not think that I have time to spend helping you debug your setup. Maybe someone else might, but they would need to know a lot of details about exactly how your system was installed.
This is the way I configured my P4 environment. I enter python3 to get into the python environment and then enter from p4.tmp import p4config_pb2 and it still shows the error
@CCCodelover I am not asking how you started python on your system and what import statements you used.
I have no idea how the P4 development tools like p4c, and simple_switch_grpc (if you have installed that) were installed on the system you have. Unless you can describe that in some way I can understand, or abandon what you have so far and follow the instructions at the link I gave in my previous comment, I am not able to take the time to figure out how you installed this software on your system. There are too many different ways to do it for me to know them all.