https://prefect.io logo
m

Moe

07/27/2023, 8:52 PM
Hi, is there a way to specify with prefect to install required python libraries at run time? I'm using git pull step for deployment but getting issues with not having required dependencies in my work-pool environment. I'm not using docker or k8s.
j

Jake Kaplan

07/27/2023, 9:19 PM
hey, yes you can use the
pip_install_requirements
pull step described here: https://docs.prefect.io/2.11.0/concepts/deployments-ux/#utility-steps
m

Moe

07/27/2023, 9:30 PM
@Jake Kaplan Thanks. I did the following:
Copy code
pull:
- prefect.deployments.steps.git_clone:
    repository: <https://gitlab.com/><organization>/<repo_name>
    branch: <branch-name>
    access_token: '{{ prefect.blocks.secret...
      }}'
- prefect.deployments.steps.pip_install_requirements:
    directory: <https://gitlab.com/><organization>/<repo_name>/<folder1>/<folder2>/
    requirements_file: requirements.txt
    stream_output: False
But I am getting this error:
NotADirectoryError: [WinError 267] The directory name is invalid
I have my
requirements.txt
file right in same directory as where the flows are located.
j

Jake Kaplan

07/28/2023, 12:49 AM
It looks like youre passing the url as a directory, you need to pass {{ clone-step.directory }} I think if you follow the example
m

Moe

07/28/2023, 2:40 PM
Is there a way to print out what this "{{ cloned-step.directory }}" looks like at run time? I am using Windows btw.