0

I installed airflow on linux server using: sudo pip3 install apache-airflow. It got installed successfully.

Then I did: export AIRFLOW_HOME=~/airflow. Finally I ran sudo airflow initdb, it's giving me an error:

sudo: airflow: command not found

echo $PATH prints something like this:

/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/xyz/abc/.local/bin:/home/xyz/abc/bin

I went through these posts:

Getting bash: airflow: command not found

How to install airflow?

But, couldn't find any solution that would solve my problem. Don't know what I'm missing. Any help regarding this would be appreciated..

sm925
  • 2,648
  • 1
  • 16
  • 28

1 Answers1

1

It looks like the execution bit was not set for the airflow binary. Run sudo chmod 775 /usr/local/bin/airflow to fix this.

SergiyKolesnikov
  • 7,369
  • 2
  • 26
  • 47
  • airflow in bin folder didn't have executable permission. I tried this, still getting `sudo: airflow: command not found` – sm925 May 27 '20 at 19:45
  • `airflow initdb` working now without `sudo`. But giving `airflow initdbTraceback (most recent call last):  File "/usr/local/bin/airflow", line 23, in     import argcompleteModuleNotFoundError: No module named 'argcomplete'` – sm925 May 27 '20 at 20:16
  • I think the Airflow installation is broken. It is generally not recommended to do `sudo pip install ...`. You can try installing it in a Python virtual environment. – SergiyKolesnikov May 27 '20 at 20:29
  • Now, from virtual environment when I do `airflow initdb` I'm getting `File "/usr/local/lib/python3.8/sqlite3/__init__.py", line 23, in     from sqlite3.dbapi2 import *  File "/usr/local/lib/python3.8/sqlite3/dbapi2.py", line 27, in     from _sqlite3 import *ModuleNotFoundError: No module named '_sqlite3'` – sm925 May 27 '20 at 21:33
  • Yes, had to install `sqlite-devel` and then recompile python. – sm925 May 28 '20 at 14:58