https://prefect.io logo
n

Nikul

02/11/2021, 2:16 PM
Hi All, I'm trying to run a flow using LocalDaskExecutor (using LocalDaskExecutor()), but I get an error: 'signal only works in main thread'. I was wondering if anyone knows what the problem could be. I get similar issues with DaskExecutor also. I'm running prefect==0.14.5, dask==2021.1.1, distributed==2020.12.0 Thank you
👀 1
z

Zanie

02/11/2021, 5:07 PM
Hi @Nikul, can you try putting your flow run/registration in a
if __name__ == "__main__"
block?
n

Nikul

02/11/2021, 5:21 PM
I still get the same error: 2021-02-11 172037+0000] ERROR - prefect.TaskRunner | Unexpected error: ValueError('signal only works in main thread')
z

Zanie

02/11/2021, 5:39 PM
Can you share your code so i can take a look?
n

Nikul

02/11/2021, 5:48 PM
The flow is essentially this:
Copy code
with Flow('f') as flow:
  result1 = task1()
    result2 = task2()

    result3=task3(result1, result2)

flow.executor = LocalDaskExecutor()

if _name_ == "_main_":
    flow.run()
z

Zanie

02/11/2021, 5:50 PM
Can you also share the full traceback from the error?