Having the following structure:
- project1
- project1.py
- protofile_pb2.py
- protofile_pb2_grpc.py
- project2
- project2.py
- protofile_pb2.py
- protofile_pb2_grpc.py
project1.py:
import protofile_pb2.py
...
project2.py:
import protofile_pb2
import project1
...
When running project2.py, I get this error:
TypeError: Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file "protofile.proto":
protofile.proto: A file with this name is already in the pool.
According to this comment, it worked for me:
pip uninstall protobuf
pip install --no-binary protobuf protobuf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With