我是不熟悉apache airflow的人,并且正在以下示例代码中进行操作: 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
如果我运行python example.py
,则会收到错误消息:
从气流导入DAG
ModuleNotFoundError:没有名为“气流”的模块
即使我按照以下步骤安装气流:
pip install apache-airflow
答案 0 :(得分:1)
运行:
pip install \
apache-airflow==1.10.10 \
--constraint \
https://raw.githubusercontent.com/apache/airflow/1.10.10/requirements/requirements-python3.7.txt
为我工作。在这里检查:https://airflow.apache.org/docs/stable/installation.html
答案 1 :(得分:0)
已解决:
我只是重新启动了PC,它现在可以正常工作