MWAA getting ModuleNotFoundError: No module named 'airflow.providers.mysql'

0

My requirements.txt file has the following

--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.5.1/constraints-3.10.txt"

apache-airflow==2.5.1
apache-airflow[amazon]==7.1.0
apache-airflow[common.sql]==1.3.3
apache-airflow[mysql]==4.0.0

However, when I execute my DAG, I get an exception in the code that tries to import airflow.providers.mysql.hooks.mysql:

ModuleNotFoundError: No module named 'airflow.providers.mysql'

How do I get MWAA to correctly install that package?

feita há um ano970 visualizações
1 Resposta
0

You are seeing ModuleNotFoundError: No module named 'airflow.providers.mysql' which means the provided requirements are not installed . Since you used Constraint file the incompatible providers are not installed , you can find the the same in MWAA --> Scheduler log groups --> requirements_install_<worker_ip>.

I suggest you to use below and try

--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.5.1/constraints-3.10.txt" apache-airflow-providers-amazon==7.1.0 apache-airflow-providers-mysql==4.0.0 apache-airflow-providers-common-sql==1.3.3

AWS
respondido há um ano

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas