我想导入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'
答案 0 :(得分:0)
我升级到2.0.0a1时遇到了相同的问题: