<@ULVA73B9P> I get the following error when doing ...
# ask-marvin
a
@Marvin I get the following error when doing flow.from_source (this is a deployment for a kubernetes worker):
Copy code
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'git'
m
It seems like you are encountering an issue while trying to use
flow.from_source
for a deployment that pulls flow code from a git repository. The error message you are receiving indicates that the 'git' command-line tool is not found on your Kubernetes worker, which is required to clone your repository. To resolve this issue, make sure that 'git' is installed on your Docker/Kubernetes environment where the Prefect deployment is taking place. You may need to modify your Docker image to include the 'git' installation, or ensure that 'git' is otherwise available in the environment running your Prefect deployment. For more information on deployment and using
flow.from_source
, please refer to the Prefect documentation on deployment. Here is a brief summary of what you would typically do to deploy a flow from a git repository:
Copy code
python
from prefect import flow

if __name__ == "__main__":
    flow.from_source(
        "<https://github.com/my_github_account/my_repo/my_file.git>",
        entrypoint="flows/no-image.py:hello_world",
    ).deploy(
        name="no-image-deployment",
        work_pool_name="my_pool",
        build=False
    )
Make sure that 'git' is installed if you are following a similar approach.