Hi there. I'm using prefect v1. I'm adding a task ...
# prefect-community
b
Hi there. I'm using prefect v1. I'm adding a task to a custom task file (library) but when executing the flow from prefect cloud, I'm getting the error: _Failed to load and execute Flow's environment: ImportError(\"cannot import name 'task_name' from 'tasks.myLib' (/opt/prefect/tasks/myLib.py)\")_ Any clue?
m
Hey @Bertangela Loret de Mola Could you provide some more context around how the flow is setup, i.e. What storage are you using for the flow? is this running locally or elsewhere, docker, k8s, etc.
b
Hi Mason, the flow is running in Docker. The flow runs a task I just added to the end of the task module. It runs fine locally, but the import from the flow is failing:
Copy code
from prefect import Flow
from prefect.tasks.secrets import PrefectSecret
from prefect.executors import LocalDaskExecutor

from tasks.myLib import task_name
m
Are you using a base prefect image or a custom image, I don't believe a base image in this case would contain your myLib file, you'd ideally want to make sure that you're folders and subfolders are installed as modules this discourse link outlines some of this in more detail https://discourse.prefect.io/t/what-exactly-does-a-prefect-agent-pull-from-storage/333
b
we are using a custom image
the tasks in the task library are being recognized by other flows, only this new one is throwing the import error from also the new flow
looks like the docker build is not updating the library files...