如何设置环境变量以使用气流?

编程入门 行业动态 更新时间:2024-10-19 06:21:51
本文介绍了如何设置环境变量以使用气流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Airflow在尝试运行DAG时返回错误,提示它找不到环境变量,这很奇怪,因为它能够找到我存储为Python变量的其他3个环境变量。那些变量根本没有问题。

Airflow is returning an error when trying to run a DAG saying that it can't find an environment variable, which is odd because it's able to find 3 other environment variables that I'm storing as a Python variable. No issues with those variables at all.

我在〜/ .profile 中拥有所有4个变量,并且也完成了

I have all 4 variables in ~/.profile and have also done

export var1="varirable1" export var2="varirable2" export var3="varirable3" export var4="varirable4"

在用户做什么下气流运行?我也已经完成了 sudo 下的 export 命令,因此我认为它们会被 airflow 运行dag

Under what user does airflow run? I've done those export commands under sudo as well, so I thought they would be picked up by airflow when it runs the dag

推荐答案

可能是因为airflow使用了非登录功能贝壳?您是否尝试过将这些行放在〜/ .bashrc而不是〜/ .profile中?

Is it maybe because airflow uses non-login shell? Have you tried putting these lines in : ~/.bashrc instead of ~/.profile ?

更多推荐

如何设置环境变量以使用气流?

本文发布于:2023-11-23 19:57:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622701.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:气流   如何设置   环境变量

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!