cannot import HiveOperator

2,777 views
Skip to first unread message

Zhengjun Chen

unread,
Oct 6, 2015, 3:32:17 PM10/6/15
to Airflow

get the following error when trying to import HiveOperator,

    

from airflow.operators import BashOperator,HiveOperator

ImportError: cannot import name HiveOperator



I think it is caused by this error in hive_hooks.py

    from hive_service import ThriftHive

ImportError: No module named hive_service


I already installed pyhs2, which can be imported successfully.


Which package should I install for the hive_service?

Zhengjun Chen

unread,
Oct 6, 2015, 5:03:18 PM10/6/15
to Airflow
I figured out, since I use HiveMetaStore, 
need to pip install hive-thrift-py

Maxime Beauchemin

unread,
Oct 7, 2015, 12:16:31 AM10/7/15
to Airflow
You can also install the sub-package: `pip install airflow[hive]` (this one was missing from the installation docs, I just added it)
Reply all
Reply to author
Forward
0 new messages