How to install airflow?

Chris picture Chris · May 5, 2016 · Viewed 38.4k times · Source

I seem to be doing sth. wrong.

https://pythonhosted.org/airflow/start.html

$ export AIRFLOW_HOME=~/airflow
$ pip install apache-airflow
Requirement already satisfied
$ airflow initdb
airflow: Command not found 

python --version
Python 2.7.10

It's weird - the installation seemed to have worked fine (with some warnings - nothing serious) saying: airflow, flask, etc. successfully installed. But even after restarting the PC (Ubuntu 15.10) airflow seems not to be a command.

Answer

Neil picture Neil · Sep 5, 2017
  • You can create a virtual environment for Airflow to keep it as a separate entity: virtualenv airflow_virtualenv
  • Go to the bin folder the virtual env: cd airflow_virtualenv/bin
  • Activate the virtual env: source activate
  • Set the airflow home path: export AIRFLOW_HOME=~/airflow [You can also put this statement in your ~/.profile or ~/.bashrc file so that you don't have to export every time]
  • Install Airflow: pip install apache-airflow [If it throws the "six" error while installing then run: pip install apache-airflow --ignore-installed six]
  • Initialize the database: airflow initdb
  • Start the webserver: airflow webserver -p 8080
  • View the Airflow UI: http://localhost:8080/