airflow ImportError: No module named hive_metastore

python
Python 2.7.5 (default, Oct 30 2018, 23:45:53) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import airflow
[2019-10-15 11:22:05,709] {__init__.py:57} INFO - Using executor CeleryExecutor
>>> from airflow.operators.hive_operator import HiveOperator
Traceback (most recent call last):
  File "", line 1, in
  File "/usr/lib/python2.7/site-packages/airflow/operators/hive_operator.py", line 18, in
    from airflow.hooks.hive_hooks import HiveCliHook
  File "/usr/lib/python2.7/site-packages/airflow/hooks/hive_hooks.py", line 28, in
    import hive_metastore
ImportError: No module named hive_metastore
>>> import hive_metastore
Traceback (most recent call last):
  File "", line 1, in
ImportError: No module named hive_metastore

解决方法如下

pip install apache-airflow[hive]  或者 pip install apache[hive]即可解决

>>> import airflow
[2019-10-15 11:25:39,566] {__init__.py:57} INFO - Using executor CeleryExecutor
>>> from airflow.operators.hive_operator import HiveOperator
>>> 

你可能感兴趣的:(python)