I use the protoc tool, from grpc-tools package (ver. 1.43.0) with python 3.8.10 to generate the data types and client and server stubs for my proto3 service. The generated file containing the stubs (ending in '_grpc.py') imports the generated file containing the message data types using an import statement with no package name: 'import <my_service_name>_pb2.py'. If I understand correctly, in order for this import to work properly in python 3 when the generated code is being included in a package, this import needs to include the name of the package containing it: 'from <my_containing_package> import <my_service_name>_pb2.py'. Is there a way to make protoc generate this import with the package name I require?
P.S. I'm currently using sed to post edit the generated file to add the package name, so only interested, here, in a way to make protoc generate the correct form for python 3 in the first place.