【问题标题】:I am unable to import airflow.operators.print_text_old from airflow我无法从气流中导入气流.operators.print_text_old
【发布时间】:2023-03-15 08:25:01
【问题描述】:

我的命令是

pip install apache-airflow

气流已成功安装,但我无法从气流中导入气流.operators.print_text_old

错误信息说:

ModuleNotFoundError:没有名为“airflow.operators.print_text_old”的模块

from datetime import timedelta
from airflow.models import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.utils.dates import days_ago
from airflow.operators.print_text_old import PrintText

图为错误提示

我可以从气流中成功导入气流.operators.print_text_old 吗?

【问题讨论】:

    标签: python airflow


    【解决方案1】:

    来自Airflow 2.0的documentation

    通过导入插件中添加的操作符、传感器、钩子 气流。{operators,sensors,hooks}. 不再是 支持,并且这些扩展应该只作为常规导入 蟒蛇模块

    您需要关注updating guide 以使您的插件与 Airflow 2 兼容。

    【讨论】:

    • 嗨,你能建议我如何从airflow.operators.print_text_old输入PrintText在更新版本@Elad
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-01
    相关资源
    最近更新 更多