I'm using proto3 in my python project. Everything work good but when I generate classes from proto files import is not correct.
I have directory structure like this.
project/endpoints/protos -> image.proto
I want output files in.
project/endpoints/grpc -> generated classes from proto files
I'm using this command to generate classes from proto files.
python -m grpc.tools.protoc \
--include_imports \
--include_source_info \
--proto_path=project/endpoints/protos \
--python_out=project/endpoints/grpc \
--grpc_python_out=project/endpoints/grpc \
image.proto
I also tried it with python3 .... but same result.
it generate the files in project/endpoints/grpc but problem is the import is not correct. When I see import it look like.
import image_pb2 as image__pb2
But it should be like this.
import project.endpoints.grpc.image_pb2 as image__pb2
Can you please let me know how to generate import like this.