Actor initialization problem

I have some code that works with ray.init(), but not with ray.init(“auto”).

For some reason with ray.init(“auto”), it complains that some code required for the initialization of the actor is not present. It’s probably similar to the following issue:

In this case there’s no way I can import the module in the class method, because the class method is in the module…

Error message:
ray.exceptions.RayActorError: The actor died because of an error raised in its creation task, ray::ActorA.init() (pid=18665, ip=
RuntimeError: The actor with name ActorA failed to import on the worker. This may be because needed library dependencies are not installed in the worker environment:

ray::ActorA.init() (pid=18665, ip=
ModuleNotFoundError: No module named ‘file that defines ActorA’

This is related to: More elegant solution for importing files - #6 by architkulkarni. Follow solution there