https://prefect.io logo
Title
j

jack

12/04/2020, 7:26 PM
A flow that runs successfully from command line fails when started from the the local website. It gives this error:
[Errno 2] No such file or directory: 'prefect'
but does not give context. Any idea which "prefect" file or directory it's looking for?
d

David Kuda

12/04/2020, 10:04 PM
You might need to specify
working_dir=/prefect
in local run:
flow.run_config = LocalRun(working_dir="/prefect")
Or alternatively:
from prefect.run_configs.local import LocalRun

run_config = LocalRun(wokring_dir="/prefect")

with Flow('name of flow', run_config=run_config) as flow:
    pass
j

jack

12/04/2020, 10:47 PM
Hmmmmmmm I don't have a "/prefect" directory. Do I need one?
d

David Kuda

12/04/2020, 10:54 PM
Oh, well, I thought that you might have named your folder where your code lives “prefect” 🙂
j

jack

12/04/2020, 10:55 PM
Is there a way to see a full stack trace when there's an error like this? Or some way to see more logging information?
j

Joseph

12/11/2020, 9:52 PM
+1
FWIW I had this same issue and it was because the ‘prefect’ executable wasn’t in my path for the environment in which the agent ran.
j

jack

12/11/2020, 10:21 PM
Same here...fixed it by activating the virtualenv