use*_*781 9 python gunicorn airflow
Traceback (most recent call last):
File "./python_runtime/bin/airflow", line 15, in <module>
args.func(args)
File "/home/admin/airflow/python_runtime/lib/python2.7/site-packages/airflow/bin/cli.py", line 423, in webserver
'gunicorn', run_args
File "/home/admin/airflow/python_runtime/lib/python2.7/os.py", line 346, in execvp
_execvpe(file, args)
File "/home/admin/airflow/python_runtime/lib/python2.7/os.py", line 385, in _execvpe
func(fullname, *argrest)
OSError: [Errno 2] No such file or directory
Run Code Online (Sandbox Code Playgroud)
我发现这个错误是由于没有gunicorn可用,所以我在os.py中打印所有路径:
/home/admin/airflow/python_runtime/bin/gunicorn
/home/admin/python2.7.2/bin/gunicorn
/home/admin/tools/local/bin/gunicorn
/home/admin/tools/bin/gunicorn
/home/admin/tools/opsdb/gunicorn
/home/admin/odps_tools/dship/gunicorn
/home/admin/php/bin/gunicorn
/home/admin/cmake/bin/gunicorn
/home/admin/jdk1.6.0_24/bin/gunicorn
/home/admin/tools/bin/gunicorn
/usr/kerberos/bin/gunicorn
/usr/local/sbin/gunicorn
/usr/sbin/gunicorn
/sbin/gunicorn
/usr/local/bin/gunicorn
/bin/gunicorn
/usr/bin/gunicorn
/usr/X11R6/bin/gunicorn
Run Code Online (Sandbox Code Playgroud)
而gunicorn存在于这条道路上
/home/admin/airflow/python_runtime/bin/gunicorn
Run Code Online (Sandbox Code Playgroud)
我的环境出了什么问题?
小智 12
Airflow 似乎期望在 PATH 中使用 gunicorn。对于我的 ubuntu 实例,这修复了它:
$ export PATH=$PATH:~/.local/bin
$ airflow webserver