Diwas Poudel
Diwas Poudel

Reputation: 847

ModuleNotFoundError: from airflow.providers.mongo.hooks.mongo import MongoHook

I have already installed the apache-airflow-providers-mongo package. It appears in the pip list, and all three dependencies are installed correctly. However, in the code, I still encounter a ModuleNotFoundError from the airflow.providers.mongo.hooks.mongo package.

My Code look like this:

import pendulum
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.hooks.base_hook import BaseHook
from airflow.providers.mongo.hooks.mongo import MongoHook
from datetime import datetime, timedelta
import pyodbc

local_tz = pendulum.timezone("Asia/Kuala_Lumpur")

...

Error is attached in Screenshot:

enter image description here

Upvotes: 0

Views: 121

Answers (0)

Related Questions