https://prefect.io logo
j

Joe B

09/08/2023, 10:58 AM
I have a prefect.yaml file:
Copy code
# Generic metadata about this project
name: flows
prefect-version: 2.11.4

# build section allows you to manage and build docker images
build:
  - prefect_docker.deployments.steps.build_docker_image:
      id: "build_image"
      requires: "prefect-docker>=0.3.1"
      image_name: "jb_test"
      tag: "0.0.3"
      dockerfile: "Dockerfile"

deployments:
  - name: "test_default"
    tags:
      - t55
    entrypoint: "flows/set_channel.py:set_channel"
    work_pool: 
      name: jb_test_docker_pool
      job_variables:
        image: "{{ build_image.image }}"
when I attempt to deploy I get a
prefect.exceptions.ScriptError: Script at 'flows/set_channel.py' encountered an exception: ModuleNotFoundError
My Dockerfile has instructions to install modules from a requirements.txt file. I can build the image manually without issue, but when I explicitly put the image name in the deployments section I get the same error.
1
s

Serina

09/08/2023, 8:11 PM
in the environment where you’re running
prefect deploy
(locally?), do you have the dependencies in the
requirements.txt
installed?
j

Joe B

09/08/2023, 8:18 PM
I didn't, but this was in fact the fix. Thank you!
🙌 1
2 Views