kestra-io/kestra
View on GitHubCaching example from the documentation fails in the latest version
Open
#8,540 opened on Apr 27, 2025
area/docsgood first issue
Description
Describe the issue
The Python example from the Caching section:
id: python_cached_dependencies
namespace: company.team
tasks:
- id: working_dir
type: io.kestra.plugin.core.flow.WorkingDirectory
tasks:
- id: python_script
type: io.kestra.plugin.scripts.python.Script
taskRunner:
type: io.kestra.plugin.core.runner.Process
warningOnStdErr: false
beforeCommands:
- python -m venv venv
- source venv/bin/activate
- pip install pandas
script: |
import pandas as pd
print(pd.__version__)
cache:
patterns:
- venv/**
ttl: PT24H
... fails in the latest Kestra version.
The first error is due to the source binary not being available.
ERROR /bin/sh: 3: source: not found
Replacing source with a dot doesn't seem to work, as the log starts showing a warning recommending to use a virtual environment.
ERROR WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
ERROR ModuleNotFoundError: No module named 'pandas'
Environment
- Kestra Version: 0.22.4 (Docker)