When I try to deploy this very project to our production installation I get these errors and airflow doesn’t startup:
02/01 10:00:58Traceback (most recent call last): File “/usr/local/lib/python3.9/site-packages/airflow/settings.py”, line 450, in import_local_settings import airflow_local_settings File “/usr/local/airflow/config/airflow_local_settings.py”, line 2, in from airflow.contrib.kubernetes.pod import Pod ModuleNotFoundError: No module named ‘airflow.contrib.kubernetes’
I’m getting the exact same error but with another DAG I’m wroking on… Were you able to solve it by any chance?
Broken DAG: [/usr/local/airflow/dags/cells_polygon_stores/cells_polygon_stores.py] Traceback (most recent call last):
File "/usr/local/airflow/dags/cells_polygon_stores/cells_polygon_stores.py", line 34, in <module>
from dags.utils.ml_operator_sup import MLOperator
File "/usr/local/airflow/dags/utils/ml_operator_sup.py", line 5, in <module>
from airflow.contrib.kubernetes.pod import Resources
ModuleNotFoundError: No module named 'airflow.contrib.kubernetes'
In my case the problem was that our Astronomer installation had not supported Airflow 2.x. Once we created a new instance that does, everything works as it should.