p4lang / p4runtime-shell

An interactive Python shell for P4Runtime
Apache License 2.0
79 stars 40 forks source link

Error occurs when starting p4runtime-shell: No module named 'google.protobuf' #98

Open sadmankiba opened 2 years ago

sadmankiba commented 2 years ago

I built the docker image and tried to run p4runtime-shell with the provided python script p4runtime-sh-docker. The script generates the following error and does not start p4runtime-shell.

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/p4runtime-sh/venv/lib/python3.8/site-packages/p4runtime_shell-0.0.2-py3.8.egg/p4runtime_sh/__main__.py", line 1, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/p4runtime-sh/venv/lib/python3.8/site-packages/p4runtime_shell-0.0.2-py3.8.egg/p4runtime_sh/shell.py", line 27, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/p4runtime-sh/venv/lib/python3.8/site-packages/p4runtime_shell-0.0.2-py3.8.egg/p4runtime_sh/p4runtime.py", line 17, in <module>
ModuleNotFoundError: No module named 'google.protobuf'
sadmankiba commented 2 years ago

I found that protobuf==4.21.4 was getting installed. Setting it to an earlier version, 3.17.3, in setup.py removes the error.