问题
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!
回答1:
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.
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
.
You should set the AIRFLOW_HOME
in your .bashrc
or .zshrc
file so the environment variables are preserved when you use new terminal.
来源:https://stackoverflow.com/questions/61681213/new-airflow-is-made-on-its-ownairflows-default-directory-other-than-the-airfl