气流无法导入气流。

时间:2020-10-15 15:16:28

标签: python airflow

我想导入Google Airflow提供商。所以我安装了它。

pip3 install apache-airflow-backport-providers-google

我能够看到package目录下的所有钩子和所有内容。

/usr/local/lib/python3.7/dist-packages/airflow/providers/google/cloud/transfer

但是当我运行导入命令时,它会失败。

from airflow.providers.google.cloud.transfers.sql_to_gcs import BaseSQLToGCSOperator


Error:
Traceback (most recent call last):
  File "test1.py", line 8, in <module>
    from custom.custom_PostgresToGCSOperator import custom_PostgresToGCSOperator
  File "/root/airflow/dags/custom/custom_PostgresToGCSOperator.py", line 8, in <module>
    from airflow.providers.google.cloud.transfers.sql_to_gcs import BaseSQLToGCSOperator
ModuleNotFoundError: No module named 'airflow.providers'

1 个答案:

答案 0 :(得分:0)

我升级到2.0.0a1时遇到了相同的问题:

也请参阅此https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-8+Split+Providers+into+Separate+Packages+for+Airflow+2.0