This post records how to use “pyenv-virtualenv” and “Airflow” together.
Install “pyenv-virtualenv”
From here.
Install the “pyenv-virtualenv” plugin
1 | git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv |
Update the “~/.zshenv” file
Update the file by adding the following content(this step is optional):
1 | # https://github.com/pyenv/pyenv-virtualenv |
Update the “~/.zshrc” file
Update the file by adding the following content:
1 | 132 eval "$(pyenv init -)" |
Now we can use “pyenv-virtualenv” to install “airflow”.
Airflow
From here.
Create an virtual environment for “airflow”
1 | # Note that install airflow with Python 3.8.0 will get error, that's why |
Update the “~/.zshrc” file
Update the file by adding content like below:
1 | # Add Apache Airflow. |
Install “Airflow” and start the local Airflow instance
1 | pyenv activate airflow |