4
bash-4.1$ airflow initdb
Traceback (most recent call last):
  File "/u/bin/airflow", line 4, in <module>
    from airflow import configuration
  File "/u/lib/python2.7/site-packages/airflow/__init__.py", line 31, in <module>
    from airflow.models import DAG
  File "/u/lib/python2.7/site-packages/airflow/models.py", line 53, in <module>
    from croniter import croniter
  File "/u/lib/python2.7/site-packages/croniter/__init__.py", line 3, in <module>
    from .croniter import croniter
  File "/u/lib/python2.7/site-packages/croniter/croniter.py", line 8, in <module>
    from dateutil.relativedelta import relativedelta
  File "build/bdist.linux-x86_64/egg/dateutil/relativedelta.py", line 5, in <module>
ImportError: cannot import name integer_types

但是口译员没有问题:

bash-4.1$ /u/bin/python2.7
Python 2.7.5 (default, Oct 17 2013, 14:04:34) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import croniter
>>> 

我假设它必须与以下内容有关:

File "build/bdist.linux-x86_64/egg/dateutil/relativedelta.py", line 5, in <module>

所以在解释器中它使用dateutilfrom/u/lib/python2.7而在气流中它使用datutilfrom build/bdist.linux-x86_64/egg/dateutil??

我什至不知道在哪里build/bdist.linux-x86_64/egg/dateutil

有人可以告诉我发生了什么以及如何告诉气流从正确导入dateutil吗?

4

1 回答 1

4

你需要安装六个python包。

只做一个pip install six

于 2016-06-28T01:48:54.643 回答