Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Airflow no module named 'kubernetes'

Answer My Own Question

I recently upgraded to Airflow 1.10 which introduced the KubernetesPodOperator however whenever I use it I see the following error in the webserver: No module named 'kubernetes'. Why does this happen and how can I fix it?

like image 242
Paymahn Moghadasian Avatar asked Mar 05 '19 20:03

Paymahn Moghadasian


2 Answers

This happens because the kubernetes library isn't installed with vanilla airflow. You can fix this by running pip install "apache-airflow[kubernetes]".

like image 160
Paymahn Moghadasian Avatar answered Oct 29 '22 01:10

Paymahn Moghadasian


For airflow 1.10.4,

pip install 'apache-airflow[cncf.kubernetes]'
like image 2
Blessy Avatar answered Oct 29 '22 01:10

Blessy