A flow that runs successfully from command line fa...
# prefect-server
j
A flow that runs successfully from command line fails when started from the the local website. It gives this error:
Copy code
[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
You might need to specify
working_dir=/prefect
in local run:
Copy code
flow.run_config = LocalRun(working_dir="/prefect")
Or alternatively:
Copy code
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
Hmmmmmmm I don't have a "/prefect" directory. Do I need one?
d
Oh, well, I thought that you might have named your folder where your code lives “prefect” 🙂
j
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
+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
Same here...fixed it by activating the virtualenv