Hi all, when we regsiter a flow , always return E...
# ask-community
j
Hi all, when we regsiter a flow , always return Error while deploying flow: FileNotFoundError(2, "No such file or directory: 'prefect'").
d
Normally this is related to a storage issue where your agent isn't able to find the dependencies or simply the location of your flow. Can you share how you store & register your flows?
j
Thanks for reply. • I have just started server and local agent, respectively. • I used MapReduce flow in the examples, and then register that flow as follows:
Copy code
....
....

with Flow("Map / Reduce 🤓", schedule=CronSchedule("20 10 * * *")) as flow:
    numbers = numbers_task()
    first_map = map_task.map(numbers)
    second_map = map_task.map(first_map)
    reduction = reduce_task(second_map)


flow.register(project_name='test')
d
Okay I would say that sounds weird... So you did the following: 1. Installed Prefect 2.
prefect backend server
3.
prefect server start
4. Create Tenant and Project (test) 5.
prefect agent start local
6. Ran your script as above 7. Waited for it to be scheduled Then I can only think of that you might registered the flow with a different version than the prefect version you currently are running. I would recommend that you update prefect, kill your existing prefect local server and start it again and register the flow again.