Apache 气流:没有模块名称“气流”

FBS*_*BSO 7 python airflow

我是 apache 气流的新手,我正在遵循以下示例代码:https : //github.com/apache/airflow/blob/master/airflow/example_dags/tutorial.py

我将上面链接中的代码复制并粘贴到example.py我桌面上的一个文件夹中。

初始代码为:

from airflow import DAG
from airflow.operators.bash_operator import BashOperator
Run Code Online (Sandbox Code Playgroud)

如果我运行python example.py,我会收到错误消息:

从气流导入 DAG

ModuleNotFoundError: 没有名为“气流”的模块

即使我按如下方式安装了气流:

pip install apache-airflow

什么是可能的解决方案?

Mic*_*Gee 6

跑步:

pip install \
 apache-airflow==1.10.10 \
 --constraint \
        https://raw.githubusercontent.com/apache/airflow/1.10.10/requirements/requirements-python3.7.txt
Run Code Online (Sandbox Code Playgroud)

为我工作。检查此处: https: //airflow.apache.org/docs/stable/installation.html