gpt4 book ai didi

python - Apache Airflow : No module name 'airflow'

转载 作者:行者123 更新时间:2023-12-02 09:34:35 29 4
gpt4 key购买 nike

我是 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 ,我会收到错误:

from airflow import DAG

ModuleNotFoundError:没有名为“airflow”的模块

即使我按如下方式安装 Airflow :

pip install apache-airflow

可能的解决方案是什么?

最佳答案

运行:

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

关于python - Apache Airflow : No module name 'airflow' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57639360/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com