问题描述
我已经在虚拟环境中安装了气流,因此在安装之前,我指定了要安装的目录。安装完成后,一切正常,没有任何问题(安装时使用的相同终端),但是如果我打开新终端,请激活环境并运行任何气流命令发生的是,产生了新的气流,而没有出现在其默认气流位置中,因此气流命令不再访问我的气流,而是访问此新气流。
即使重新安装也无济于事。
这怎么可能同时在一个终端中起作用而在另一个终端中不起作用!
提前谢谢!
I've installed airflow in a virtual env so prior to installing it, I specified a directory in which the install will occur. Installation is done everything works fine without any issues(its the same terminal that i used for installation) but if i open a new terminal, activate the env and run any airflow command what happens is,a new airflow get generated out of no where in its default airflow location so the airflow commands no longer access my airflow and rather access this new one. Even re-installation didn't help.How is this even possible that at the same time, it works in one terminal but not in other!Thank you in advance!
推荐答案
这是因为当您打开新终端并激活虚拟环境时,气流$在设置
AIRFLOW_HOME
环境变量之前,c $ c>仍然不知道在哪里寻找配置。
That is because when you open a new terminal and activate the Virtual Env, airflow
still does not know where to look for configs until the AIRFLOW_HOME
environment variable is set up.
最有可能在第二个终端中没有设置 AIRFLOW_HOME
环境变量,因此气流使用默认的 AIRFLOW_HOME
即 $ HOME / airflow
。
Most likely in your second terminal, you don't have AIRFLOW_HOME
environment variable set, hence airflow uses the default AIRFLOW_HOME
i.e $HOME/airflow
.
您应该设置 AIRFLOW_HOME
在您的 .bashrc
或 .zshrc
文件中,以便在使用新终端时保留环境变量。
You should set the AIRFLOW_HOME
in your .bashrc
or .zshrc
file so the environment variables are preserved when you use new terminal.
这篇关于除了我在特定目录中安装的气流以外,新的气流是由自己(气流的默认目录)生成的。怎么了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!