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?

질문됨 일 년 전970회 조회
1개 답변
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
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠