'Import error ModuleNotFound for Airflow aws_lambda

I am using Airflow 2.2.5 and want to trigger an AWS lambda function.

This is my Dockerfile

FROM apache/airflow:latest

RUN pip install --no-cache-dir apache-airflow-providers-docker==2.5.0 boto3==1.21.45 apache-airflow-providers-amazon==3.0.0

And here is how I import aws_lambda Invoke:

from airflow.providers.amazon.aws.operators.aws_lambda import AwsLambdaInvokeFunctionOperator

I followed the instructions in the documentation. But unfortunately the module can't be found.



Solution 1:[1]

Actually all provider packages can be installed via apache-airflow with the following addition:

pip install apache-airflow[docker,amazon]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 dl.meteo