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?

gefragt vor einem Jahr968 Aufrufe
1 Antwort
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
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen