Use following steps :
Install Airflow: Use pip install apache-airflow.
Import in Code: Use from airflow import DAG (not apache-airflow).
Test Installation: Run airflow version to confirm.
Place DAG: Save your DAG in ~/airflow/dags/ and start the webserver with airflow webserver and airflow scheduler.