Tony G
02/12/2025, 6:24 PMfrom prefect.task_worker import serve
I'm getting ModuleNotFoundError: No module named 'prefect.task_worker'
I found that I can import task_server
instead of `task_worker`:
from prefect.task_server import serve
but then when I try to schedule a deferred task using my_background_task.delay()
, I get:
AttributeError: 'Task' object has no attribute 'delay'
Has the API changed for background tasks?Nate
02/12/2025, 6:31 PMprefect
version? what does prefect version
show for you?Nate
02/12/2025, 6:33 PM» uv run --with prefect python -c "from prefect.task_worker import serve; print(serve)"
Tony G
02/12/2025, 6:34 PMNate
02/12/2025, 6:34 PMTony G
02/12/2025, 11:21 PMprefect.task_worker
to run background tasks, submit the background task to an already-existing work queue that you have configured in Prefect Cloud?Nate
02/12/2025, 11:25 PMTony G
02/13/2025, 2:05 AM