We want to be able to turn any function into singl...
# prefect-community
We want to be able to turn any function into single-task flows. I’ve created a wrapper to do this (as pictured). Calling
on the flow that gets returned works fine, and registering the flow seems to be fine too (using k8s run). However, when we try to actually run it, we get the following error:
Copy code
Failed to load and execute flow run: FlowStorageError('An error occurred while unpickling the flow:\n  ModuleNotFoundError("No module named \'build_index\'")\nThis may be due to a missing Python module in your current environment. Please ensure you have all required flow dependencies installed.')
Am I missing something obvious?
Do you recognize
? I don’t know where that is from
That’s used by the function I’m passing into the wrapper
flow = make_into_flow(flow_name, build_index_from_cache
and we have
from directory.build_index import build_index_from_cache
Ah then that just needs to be available in the execution environment for that it’s understood when unpickled
How do I make that available? It should already exist in the docker image
It seems like it can’t resolve the import though. Either add it to PYTHONPATH or install it as a library with pip? Have you done that before?