Issues with deploying I am running ```prefect dep...
# ask-community
y
Issues with deploying I am running
Copy code
prefect deployment build my_flow.py:flow_name -q que1 --tag LIN --name proj_name --skip-upload --pool "default-agent-pool"
and I get en error:
encountered an exception: ModuleNotFoundError("No module named 'my_project_source")
I tried to add everywhere where that are imports in the project, from other parts of the project
Copy code
from pathlib import Path
import sys
import os

path = Path(os.path.dirname(__file__))
sys.path.append(path)
sys.path.append(path.parent)
but this did not help do I have to create a python package from the code in order to deploy it? if there is a way to deploy a project without turning it to a python package, what is it ? I do not see in https://docs.prefect.io/latest/concepts/deployments/ information on
prefect deployment build
was this deprecated ?
In the past it use to work without having to create a python package from a project and pip install it
do we now just manually create a deployment yaml file ?
It looks like need to role back prefect to version 2.11.5 for it to work Hi @Nate any thoughts how I can both keep recent version of prefect and be able to deploy ? I could not find relevant documentation
Are we no longer suppose to deploy using the
prefect deployment build
and use
Copy code
if __name__ == "__main__":
    my_flow.serve(...)
instead ? if so, do we need to remove the
.serve
after deploying, if we want to make changes and run code like any other python code?
n
deployments can be created via prefect deployment build, prefect deploy, or .serve although prefect deployment build aka block based deployments will soon be deprecated (meaning they will still be supported, but will emit a warning that it will be removed in a future release), it still works if you’re trying to do block based deployments by running an agent (ie an old version of a worker) if you just want to run a process as a deployment without extra fuss or dynamic infra allocation, .serve is the simplest way the modern recommendation for deployments with dynamic infra allocation is to run a worker and use prefect deploy i am ooo this week and next, so for follow ups id suggest posting in #CL09KU1K7 (otherwise ill come back to this thread later when im back)