# prefect-community

Tony Piazza

10/18/2022, 9:13 PM
i'm trying to deploy the Prefect agent to GKE. I need a specific version of Python (3.9.13) on the image so I changed the Dockerfile as follows:
Copy code
FROM python:3.9.13

COPY requirements.txt .

RUN pip install -r requirements.txt
Prefect is included in the requirements. When the job is launched, I get the following error:
Copy code
Flow could not be retrieved from deployment.
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/prefect/", line 247, in retrieve_flow_then_begin_flow_run
    flow = await load_flow_from_flow_run(flow_run, client=client)
  File "/usr/local/lib/python3.9/site-packages/prefect/client/", line 47, in with_injected_client
    return await fn(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/prefect/", line 159, in load_flow_from_flow_run
    await storage_block.get_directory(from_path=deployment.path, local_path=".")
  File "/usr/local/lib/python3.9/site-packages/prefect/", line 144, in get_directory
    shutil.copytree(from_path, local_path, dirs_exist_ok=True)
  File "/usr/local/lib/python3.9/", line 566, in copytree
    with os.scandir(src) as itr:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/prefect/flows'
How do I resolve this?
I can see the path attribute at the bottom of the generated deployment file:
Copy code
path: /opt/prefect/flows

Jeff Hale

10/18/2022, 9:25 PM
Hi Tony. The Prefect Docker image has a few more steps, such as changing the workdir. You can see here.
👀 1