首页 > 解决方案 > DAG runtime error with creating Airflow.cfg file

问题描述

First time creating a DAG. Each time I run within Pycharm, I get a FileExistsError [WinError 183], in addition to, an AirflowConfigException. Both errors describe how their attempts to create airflow.cfg failed because this file already exists within ~/airflow/airflow.cfg

How do I let the code know to use the existing cfg file? I read elsewhere this may be related to setting an AIRFLOW_HOME environment variable?

标签: pythonerror-handlingruntime-errorairflow

解决方案


是的,这里有多种选择。

  1. 您可以在您所在的目录中启动气流airflow.cfg。但是强烈建议不要这样做。
  2. 在启动气流之前,请先运行export AIRFLOW_HOME=/path/to/your/airflow.cfg命令。
  3. 您可以AIRFLOW_HOME在 bash 或 zsh 配置文件中设置环境变量。这取决于您使用的终端。这是推荐的方式。

推荐阅读