I am unable to import airflow.operators.print_text_old from airflow

Viewed 415

My command is

pip install apache-airflow

and the airflow was successfully installed but I am unable to import airflow.operators.print_text_old from airflow

The error message says:

ModuleNotFoundError: No module named '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

The picture shows the error message

Error message

Hoe can I successfully import airflow.operators.print_text_old from airflow?

1 Answers

From the documentation of Airflow 2.0:

Importing operators, sensors, hooks added in plugins via airflow.{operators,sensors,hooks}.<plugin_name> is no longer supported, and these extensions should just be imported as regular python modules

You need to follow the updating guide to make your plugin compatible with Airflow 2.

Related