Skip to content

Example DAGs import error #12247

Description

@anirudhbagri

Apache Airflow version: 2.0.0b2

Kubernetes version (if you are using kubernetes) (use kubectl version):

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):macOS
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

What happened:
Running airflow db init followed by airflow dag list give the following error:

[2020-11-10 19:04:24,553] {dagbag.py:297} ERROR - Failed to import: /Users/abagri/Workspace/airflow2.0/venv/lib/python3.8/site-packages/airflow/example_dags/example_kubernetes_executor_config.py
Traceback (most recent call last):
  File "/Users/abagri/Workspace/airflow2.0/venv/lib/python3.8/site-packages/airflow/models/dagbag.py", line 294, in _load_modules_from_file
    loader.exec_module(new_module)
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/abagri/Workspace/airflow2.0/venv/lib/python3.8/site-packages/airflow/example_dags/example_kubernetes_executor_config.py", line 23, in <module>
    from kubernetes.client import models as k8s
ModuleNotFoundError: No module named 'kubernetes'
[2020-11-10 19:04:24,558] {dagbag.py:297} ERROR - Failed to import: /Users/abagri/Workspace/airflow2.0/venv/lib/python3.8/site-packages/airflow/example_dags/example_dag_decorator.py
Traceback (most recent call last):
  File "/Users/abagri/Workspace/airflow2.0/venv/lib/python3.8/site-packages/airflow/models/dagbag.py", line 294, in _load_modules_from_file
    loader.exec_module(new_module)
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/abagri/Workspace/airflow2.0/venv/lib/python3.8/site-packages/airflow/example_dags/example_dag_decorator.py", line 25, in <module>
    from airflow.providers.http.operators.http import SimpleHttpOperator
ModuleNotFoundError: No module named 'airflow.providers'


*****// Followed by name of other DAG, omiting here *******

What you expected to happen:
Expect the example dags to import files

How to reproduce it:

  1. Run airflow db init
  2. Run airflow dags list

Anything else we need to know:

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugThis is a clearly a bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions