Hi,
I'm facing issues importing dependencies of my Python Pipeline. I intend
to use gRPC to communicate with remote RPC service, hence I have the
following project structure:
script.py
|---- service_pb2.py
|---- service_pb2_grpc.py
I created setup.py with something like
setup(name='...',
version='1.0',
description='...',
py_modules=['service_pb2', 'service_pb2_grpc'])
That seems to work, it packages the dependencies, for example by
'python3 setup.py sdist'. I pass this file to the Pipeline using
--setup_file, but I have no luck using the module. Though the script is
executed, it fails once I try to open a channel using (DoFn.setup):
def setup(self):
self.channel = grpc.insecure_channel(self.address)
self.stub = service_pb2_grpc.RpcServiceStub(self.channel)
with exception ModuleNotFoundError: No module named 'service_pb2_grpc'.
Am I doing something obviously wrong?
Jan