Vinicius Gambi
08/15/2024, 5:21 PMMarvin
08/15/2024, 5:22 PMrun_shell_script
step to activate the virtual environment within your deployment configuration. Below is an example:
1. Create and configure your virtual environment:
shell
python -m venv myenv
source myenv/bin/activate # On Windows, use: myenv\Scripts\Activate.ps1
pip install -r requirements.txt
2. Deploy your flow with the virtual environment:
yaml
pull_steps:
- prefect.deployments.steps.run_shell_script:
id: activate-venv
script: source myenv/bin/activate # On Windows, use: myenv\Scripts\Activate.ps1
stream_output: true
This will ensure that your deployment activates the virtual environment before executing further steps.
For more detailed information, you can refer to the Prefect Deployment Guide.
If you encounter issues or need additional examples, see related GitHub discussions:
- Database QueuePool issue with large task flows: https://github.com/PrefectHQ/prefect/issues/6492
- Problems creating a working KubeClusterConfig from the Blocks page: https://github.com/PrefectHQ/prefect/issues/8640Vinicius Gambi
08/15/2024, 5:57 PMMarvin
08/15/2024, 5:57 PM