Using the latest version of k-wave-python from github on Ubuntu (WSL2).
(sim) ~ python3 bmode_reconstruction_example.py
Traceback (most recent call last):
File "/home/tnie/code/sim/k-wave-python/examples/bmode_reconstruction_example.py", line 4, in <module>
from kwave.reconstruction.beamform import beamform
File "/home/tnie/code/sim/k-wave-python/kwave/reconstruction/beamform.py", line 4, in <module>
from uff import UFF, ChannelData
File "/home/tnie/miniconda3/envs/sim/lib/python3.10/site-packages/uff/__init__.py", line 48, in <module>
from uff import converters, model # noqa
File "/home/tnie/miniconda3/envs/sim/lib/python3.10/site-packages/uff/model/__init__.py", line 48, in <module>
from . import uff_pb2 as uff_pb # noqa
File "/home/tnie/miniconda3/envs/sim/lib/python3.10/site-packages/uff/model/uff_pb2.py", line 33, in <module>
_descriptor.EnumValueDescriptor(
File "/home/tnie/miniconda3/envs/sim/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 755, in __new__
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
Trying to run the example but getting a type error in the
uffdependency.Using the latest version of k-wave-python from github on Ubuntu (WSL2).