-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No module named '__prefect_loader__' #5984
Comments
currently failing because of PrefectHQ/prefect#5984
When the flow script is run directly, we lose the ability to infer the module name since it's replaced with from my_flows import kubes_flow
Deployment(
flow=kubes_flow,
) I'll try to find a way to determine the module path when they're in the same file. Also note, if your module is a relative import rather than an installed module, this will fail while using the CLI. I'll investigate a fix for that, but you can call |
Thanks @madkinsz I'll try that. FYI I'm creating the deployment via the CLI, eg: |
move deployments into their own module so the flow module name can be determined see PrefectHQ/prefect#5984 (comment)
Yep splitting out the deployment into its own file works! 🥳 |
I get a similar error when using Error
Minimal reproducible exampleI have the following 2 files. from prefect import flow, task
from prefect_dask.task_runners import DaskTaskRunner
def inner():
return 0
@task
def bar():
inner()
@flow(task_runner=DaskTaskRunner())
def foo():
future = bar()
future.wait()
from prefect.deployments import Deployment
from flow import foo
spec = Deployment(
flow=foo,
tags=["test"],
) |
Related to #6629 |
See also #6762 |
FWIW I ran into a similar error when attempting to run a computation on a Dask cluster from inside a running Prefect flow. Here's a description and change to |
Description
The flow run errors with:
Reproduction / Example
flows/kubes_flow.py:
Here's the block for my flow:
It looks like
__prefect_loader__.kubes_flow
is being stored as the module name rather thanflows.kubes_flow
prefect 2.0b8
The text was updated successfully, but these errors were encountered: