Hi, I try to deploy my flows with a deployment (af...
# ask-community
l
Hi, I try to deploy my flows with a deployment (after using
prefect init
) but I have this error Ive no idea why :
Copy code
Your flow entrypoint must include the name of the function that is the entrypoint to your flow.
Try prefect.yaml:<flow_name> as your entrypoint. If you meant to specify 'prefect.yaml' as the deployment name, try `prefect deploy -n prefect.yaml`.
I dont really what I did wrong... Thx for ur help !
There is my `prefect.yaml`:
Copy code
deployments:
- name: sync_tmdb
  version: 1
  tags: ["tmdb"]
  description: "Sync TMDB data"
  schedule: {
    "timezone": "Europe/Paris",
    "cron": "0 9 * * *"
  }
  # flow_name: sync_tmdb
  entrypoint: sync_tmdb/sync_tmdb.py:sync_tmdb
  parameters: {}
  work_pool:
    name: "VPS_Worker_1"
    work_queue_name: null
    job_variables: {
      "env": {
        "EXTRA_PIP_PACKAGES": "more_itertools psycopg2-binary"
      }
    }
My git repo architecture is like :
Copy code
my_repo/
  sync_tmdb/
    sync_tmdb.py
    __main__.py
    __init__.py
    flows/
      languages/
        sync_language.py
  prefect.yaml
  .prefectignore
n
hi @Loup ! can you show what CLI commands you tried?
it’s confusing to me that it thinks the deployment name is prefect.yaml! that should generally not be the case
l
I did that
I've tried
prefect deploy --all
but it give me error with
prefect.variables
cant import (no idea why)
Okay I was able to push my deployment to prefect with
prefect deploy -all
but my flows crash because of
prefect.variables
Is it a problem with my VPS (which is a worker)
okay the problem was the image use by my worker (with docker), it was using
prefecthq/prefect:2-latest
instead of
prefecthq/prefect:3-latest
n
👍
yeah generally you can use prefect deploy in a couple ways
Copy code
prefect deploy --all
prefect deploy some/path/to/flow.py:flow_fn
prefect deploy -n as-named-in-prefectyaml
and you can use
Copy code
prefect --no-prompt deploy ...
to avoid the CLI asking you questions