Jason Wiener
09/25/2025, 4:41 PMprefect deploy
scanning for flows? If it is in the same folder as my prefect.yaml, but it never contains flows to be deployed.Marvin
09/25/2025, 4:41 PMMarvin
09/25/2025, 4:46 PMprefect deploy
is walking your project and hitting your virtualenv, the best fix is to avoid discovery by explicitly targeting your flows.
Options that work well:
- Pass an explicit entrypoint when deploying
prefect deploy path/to/flow_file.py:flow_function
This skips scanning the rest of the tree.
- Define deployments with explicit entrypoints in prefect.yaml and deploy by name
# prefect.yaml
name: my-project
deployments:
- name: etl-dev
entrypoint: flows/etl.py:etl
work_pool: default
Then run:
prefect deploy --name etl-dev
- Make your project root not include the virtualenv
- Move .venv/
outside the project directory that contains prefect.yaml
- Or keep prefect.yaml
in a subfolder that contains only your code, then either run prefect deploy
from that subfolder or reference it with:
prefect deploy --prefect-file subdir/prefect.yaml
Note: .prefectignore
can keep .venv/
out of packaged code, but it doesn’t change flow discovery behavior. It’s still a good idea to include:
# .prefectignore
.venv/
venv/
Docs for reference:
- Prefect YAML and deployments: prefect.yaml
- Deployment how-to: Deployments guide
If you share how you’re invoking prefect deploy
(e.g., with or without an entrypoint, relying on discovery vs. named deployments), I can suggest the most streamlined change for your setup.