Trying to use the DaskTaskRunner in Prefect 2.0 an...
# prefect-community
t
Trying to use the DaskTaskRunner in Prefect 2.0 and getting this error. I am following the published documentation.
Copy code
from prefect.task_runner import DaskTaskRunner
ModuleNotFoundError: No module named 'prefect.task_runner'
Is there an extra that needs installed?
βœ… 1
a
sorry for that, try:
Copy code
pip install prefect-dask
k
I think it’s
prefect.task_runners
?
Yes it is from here
a
and then in your code:
Copy code
from prefect_dask.task_runners import DaskTaskRunner
t
From the Task Runners page....
Copy code
from prefect import flow
from prefect.task_runner import DaskTaskRunner

@flow(task_runner=DaskTaskRunner(address="<http://my-dask-cluster>"))
def my_flow():
    pass
a
ahh Kevin is right; this is just a typo in the docs we might not have moved that yet to a collection Tim, what I showed is what will come in the next releases - a spoiler: Dask and Ray will move to separate collections to make a cleaner separation and prevent users from having to install dependencies they may not need (dask, ray, ...)
t
ok, so it
prefect-dask
an extra, or separate dependency? I use
poetry
to manage our stack
a
forget my message for now, this is just a typo
Copy code
from prefect.task_runners import DaskTaskRunner
k
I think
Copy code
from prefect.task_runners import DaskTaskRunner
will work but eventually you will need
prefect-dask
installed
πŸ‘ 1
t
Ok, thanks everybody
πŸ™Œ 1