https://prefect.io logo
Title
i

Ian Andres Etnyre Mercader

08/08/2022, 11:05 PM
Hi guys, porting my code to prefect 2.0 and I have got it running local, but when creating a deployment to run it on an agent I'm getting this error on the UI. Deployment cmd:
PYTHONPATH=/home/alburati/Proyectos/pipeline/src prefect deployment build src/sources/biorxiv/flows/biorxiv_main_flow.py:biorxiv_main_flow -n 'source_flow' -t source_work
Error:
Flow could not be retrieved from deployment.
Traceback (most recent call last):
  File "/home/alburati/anaconda3/envs/nlp_env/lib/python3.7/site-packages/prefect/engine.py", line 246, in retrieve_flow_then_begin_flow_run
    flow = await load_flow_from_flow_run(flow_run, client=client)
  File "/home/alburati/anaconda3/envs/nlp_env/lib/python3.7/site-packages/prefect/client.py", line 104, in with_injected_client
    return await fn(*args, **kwargs)
  File "/home/alburati/anaconda3/envs/nlp_env/lib/python3.7/site-packages/prefect/deployments.py", line 325, in load_flow_from_flow_run
    await storage_block.get_directory(from_path=None, local_path=".")
  File "/home/alburati/anaconda3/envs/nlp_env/lib/python3.7/site-packages/prefect/filesystems.py", line 95, in get_directory
    shutil.copytree(from_path, local_path)
  File "/home/alburati/anaconda3/envs/nlp_env/lib/python3.7/shutil.py", line 324, in copytree
    os.makedirs(dst)
  File "/home/alburati/anaconda3/envs/nlp_env/lib/python3.7/os.py", line 223, in makedirs
    mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '.'
Any suggestions?
1
👀 1
b

Bianca Hoch

08/09/2022, 7:05 PM
Hello Ian, could we get a minimally reproducible example? That'll help us with troubleshooting.
👀 1
i

Ian Andres Etnyre Mercader

08/09/2022, 10:53 PM
Hi Blanca, constructing my example found that in my original conda enviorment I installed prefect with
pip install
, correcting this and installing with
conda install -c conda-forge prefect
removed the error.
1
b

Bianca Hoch

08/10/2022, 1:51 PM
Hooray! Glad it's working now.
s

Segun Adelowo

08/11/2022, 10:30 AM
@Khuyen Tran @Bianca Hoch I am getting this error also, but I prefer to work with pip install and not conda install. Pls any suggestions I can follow to fix this also? Python version: 3.7.9 Prefect version: 2.0.4, I was using the leo_flow example here: https://docs.prefect.io/tutorials/deployments/
Update on the issue.. so I upgraded my Python version to 3.10.5 from 3.7.9 and the error is no more. @Ian Andres Etnyre Mercader
🔥 1
👍 1
b

Bianca Hoch

08/11/2022, 1:54 PM
Great job finding out the solution Segun!
🙂 1