You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airflow.apache.org by ra...@gmail.com, ra...@gmail.com on 2018/11/19 00:40:00 UTC

How to change Apache Airflow Python path from Python 2.7 to 3?

Initially, I had installed Apache Airflow and python 2.7 is set as default path. Now, I'm trying to change path from 2.7 to 3. Is it possible to do so or do I have re-install the airflow and set the python path? Any pointers would be helpful?

Thanks in advance!

Re: How to change Apache Airflow Python path from Python 2.7 to 3?

Posted by Dennis O'Brien <de...@dennisobrien.net>.
This is a good case for using conda environments or virtualenv environments.

With conda you would create a new conda environment that uses python 3.6,
install your dependencies including airflow in that environment, then use
the airflow version in that environment.

To figure out the versions of python compatible with the conda recipes:
$ conda search airflow --channel conda-forge
Currently, 3.6 is the latest supported.

To create a conda environment with python 3.6 and install airflow from
conda-forge:
$ conda create --name=airflow --channel=conda-forge python=3.6 airflow

To enable that environment and run airflow, there are a few options.  Once
way is to activate the environment with the command then call airflow.
$ conda activate airflow
(airflow) $ airflow version
...

Another way is to call the airflow command with the full path.  This means
you don't have to activate the environment, just call the command in the
conda environment bin directory.
$ /anaconda3/envs/airflow/bin/airflow version
...


Good luck.

cheers,
Dennis


On Mon, Nov 19, 2018 at 10:16 AM rajasimmangandhi@gmail.com <
rajasimmangandhi@gmail.com> wrote:

> Initially, I had installed Apache Airflow and python 2.7 is set as default
> path. Now, I'm trying to change path from 2.7 to 3. Is it possible to do so
> or do I have re-install the airflow and set the python path? Any pointers
> would be helpful?
>
> Thanks in advance!
>