python - 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?
解决方案
是的,这里有多种选择。
- 您可以在您所在的目录中启动气流
airflow.cfg
。但是强烈建议不要这样做。 - 在启动气流之前,请先运行
export AIRFLOW_HOME=/path/to/your/airflow.cfg
命令。 - 您可以
AIRFLOW_HOME
在 bash 或 zsh 配置文件中设置环境变量。这取决于您使用的终端。这是推荐的方式。
推荐阅读
- filenames - Inno Setup,从文件名中获取字符串
- asp.net-core-mvc - .net core 3状态码405在使用httpClient和Fiddler时响应?
- permissions - 在 Fedora 31 中,如何为 Podman 容器中运行的 nginx 设置权限?
- python - 计算大小时numpy数组中的索引太多
- javascript - 保存数据的多个变量 - 哪个具有最高值?
- mysql - 尽管使用外键约束,低索引基数和有太多其他索引是否需要从表中删除索引?
- python - 在循环中获取数据的问题(Scrapy)
- javascript - 在角度js中动态构造具有键和值作为列表的对象
- php - 在 div 类中自动插入图像
- angular - ngOnInit 在 Angular 的组件内初始化 EventEmitter 变量是否太晚了?