29

I am getting

-bash: airflow: command not found

after installing Apache Airflow. I am using Google Cloud Compute Engine and OS is Debian 9 (Stretch).

I have followed the below steps:

export AIRFLOW_HOME=~/airflow

pip install apache-airflow
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Md Sirajus Salayhin
  • 4,974
  • 5
  • 37
  • 46
  • 2
    I had the same problem on Ubuntu 18. You need to use "sudo pip install apache-airflow" as you have written – Regfor Jan 20 '19 at 08:15

4 Answers4

58

I have uninstalled Apache Airflow and installed it with the sudo command (i.e., sudo pip install apache-airflow). After that it worked fine.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Md Sirajus Salayhin
  • 4,974
  • 5
  • 37
  • 46
14

If installed with sudo, as mentioned by Sirajus, it will be placed in /usr/local/bin/.

Without sudo, it will be placed in the ~/.local/bin/ folder. This folder will not be added to the PATH environment variable automatically.

So you can either add it to the PATH environment variable or install it using sudo.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Adrian
  • 171
  • 1
  • 3
  • Welcome to stack overflow. Please consider using the code format for your bash commands. cheers. – sao Feb 05 '20 at 21:03
  • It also depends on the location of Python installation, in my case Python was installed in `/mnt/vol1/python3.7` and airflow binary was present here `/mnt/vol1/python3.7/bin/airflow` – lycanthrope10100 May 21 '21 at 07:21
1

Post install, re-load environment variable and you are good to go.

Raj
  • 105
  • 9
0

Where does your pip install Apache Airflow to? It could be to /usr/local/bin or similar.

Make sure that that directory is in your $PATH.

This isn't related to Apache Airflow, just your environment setup.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Milage
  • 354
  • 2
  • 11