0

**Can't run prefect worker in localhost. The system gaves the next problem. **


> *Flow could not be retrieved from deployment.Traceback (most recent call last):File "<frozen importlib._bootstrap_external>", line 846, in
> exec_moduleFile "<frozen importlib._bootstrap_external>", line 982, in
> get_codeFile "<frozen importlib._bootstrap_external>", line 1039, in
> get_dataFileNotFoundError: [Errno 2] No such file or directory:
> '3.4/orches.py' ``` ``` The above exception was the direct cause of
> the following exception: ``` ``` Traceback (most recent call
> last):File
> "/opt/anaconda3/envs/prefect-ops/lib/python3.9/site-packages/prefect/engine.py",
> line 276, in retrieve_flow_then_begin_flow_runflow = await
> load_flow_from_flow_run(flow_run, client=client)File
> "/opt/anaconda3/envs/prefect-ops/lib/python3.9/site-packages/prefect/client/utilities.py",
> line 40, in with_injected_clientreturn await fn(*args, **kwargs)File
> "/opt/anaconda3/envs/prefect-ops/lib/python3.9/site-packages/prefect/deployments.py",
> line 220, in load_flow_from_flow_runflow = await
> run_sync_in_worker_thread(load_flow_from_entrypoint,
> str(import_path))File
> "/opt/anaconda3/envs/prefect-ops/lib/python3.9/site-packages/prefect/utilities/asyncutils.py",
> line 91, in run_sync_in_worker_threadreturn await
> anyio.to_thread.run_sync(File
> "/opt/anaconda3/envs/prefect-ops/lib/python3.9/site-packages/anyio/to_thread.py",
> line 33, in run_syncreturn await
> get_asynclib().run_sync_in_worker_thread(File
> "/opt/anaconda3/envs/prefect-ops/lib/python3.9/site-packages/anyio/_backends/_asyncio.py",
> line 877, in run_sync_in_worker_threadreturn await futureFile
> "/opt/anaconda3/envs/prefect-ops/lib/python3.9/site-packages/anyio/_backends/_asyncio.py",
> line 807, in runresult = context.run(func, *args)File
> "/opt/anaconda3/envs/prefect-ops/lib/python3.9/site-packages/prefect/flows.py",
> line 864, in load_flow_from_entrypointflow =
> import_object(entrypoint)File
> "/opt/anaconda3/envs/prefect-ops/lib/python3.9/site-packages/prefect/utilities/importtools.py",
> line 201, in import_objectmodule =
> load_script_as_module(script_path)File
> "/opt/anaconda3/envs/prefect-ops/lib/python3.9/site-packages/prefect/utilities/importtools.py",
> line 164, in load_script_as_moduleraise ScriptError(user_exc=exc,
> path=path) from excprefect.exceptions.ScriptError: Script at
> '3.4/orches.py' encountered an exception: FileNotFoundError(2, 'No
> such file or directory')*

**My main flow function is next: **enter image description here

I think that that my function does not see my data folder, but after double checking the problem is another.

By the way, in prefect documentations i found this explanation of error. enter image description here

0 Answers0