Skip to content

Python dependencies not found on the Kubernetes task runner (ModuleNotFoundError) #372

@Skraye

Description

@Skraye

When a Python Script/Commands task declares dependencies and runs on a remote task runner (e.g. Kubernetes), the script fails with ModuleNotFoundError.

The resolved packages are installed under the working dir (.kestra_additional_python_lib) and exposed via PYTHONPATH, but PYTHONPATH is set to the absolute worker path (e.g. /tmp/<id>/.kestra_additional_python_lib) instead of being remapped to the runner working dir (e.g. /kestra/working-dir/...). With the Docker runner the worker working dir is mounted at the same path so it worked; the Kubernetes runner mounts it at /kestra/working-dir, so the path doesn't exist in the pod.

Affects python.Script and python.Commands.

Metadata

Metadata

Assignees

Labels

area/pluginPlugin-related issue or feature request

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions