I have to work on a shared Airflow 1.10 project, so I have cloned the repository and the structure is as follow:
airflow
├── airflow.cfg
├── airflow.db
├── dags
│ ├── dags_here.py
│
├── dags_conf
│ ├── some settings for dags
│ │ └── settings.py
│ │ ├── __init__.py
│ │ ├── settings.py
│ │ └── todo.txt
| |__ init.py
|
├── utilities
│ ├── __init__.py
│ └── some_name
│ ├── airflow
│ │ └── hooks.py
└── sensors.py
└── plugins.py
│ ├── common
│ │ ├some_other_code_files.py
│ ├── __init__.py
|
├── README.md
├── unittests.cfg
└── venv
├── lib64 -> lib
└── pyvenv.cfg
But when I try to list dags I face this error:
plugins_manager.py:225} ERROR - No module named 'common' Traceback (most recent call last): File "/home/xxx/venv/lib/python3.8/site-packages/airflow/plugins_manager.py", line 218, in m = imp.load_source(namespace, filepath) File "/usr/lib/python3.8/imp.py", line 171, in load_source module = _load(spec) File "", line 702, in _load File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/home/xxx/airflow/utilities/xxx/common/insert_obj.py", line 3, in from common.xxxxx import Class_name ModuleNotFoundError: No module named 'common' [2021-05-30 23:13:05,933] {plugins_manager.py:226} ERROR - Failed to import plugin /home/xxxx/airflow/utilities/xxxxx/common/dag_file.py
I have tried below configs inside may airflow.cfg but always the same error:
plugins_folder=/home/xxx/airflow/utilities
Adding a parent directory inside Airflow folder called plugins with an __init__.py file and copying utilities inside that:
plugins_folder=/home/xxx/airflow/plugins