I'm trying to import the PostgresOperator from the airflow package:
from airflow.providers.postgres.operators.postgres import PostgresOperator
But I'm getting the following error: Cannot find reference 'postgres' in imported module airflow.providers.
The solution was to run the following in the terminal, using the project's virtualenv: pip install 'apache-airflow[postgres]'.
Please notice that it won't work if you don't wrap the name of the package between single-quotes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With