So I'm trying to have a remote Pyro5 object receive serialized arbitrary functions to execute them. The remote objects are run on a separate machine, registered on a Pyro5 name-server.
The built in serializer (serpent) in Pyro5 does not support function serialization, so I manually serialize the function with Dill, yielding a bytes type, which I send over when calling the remote object through Pyro5. I subsequently de-serialize the function on the remote-side, which yields the error:
ImportError: cannot import name 'Annotated' from 'typing' (/usr/lib/python3.8/typing.py)
I've tested to implement a separate function which sends the serialized data back to the client from the remote object, where I subsequently de-serialized the data into a function, successfully. This implies that using Dill on the remote end, as opposed to Pyro5, is the culprit.