为什么主管 gunicorn 显示未找到致命错误命令?

Raj*_*ddy 4 django ubuntu amazon-web-services supervisord gunicorn

当我检查状态(sudo supervisorctl status)时,它是这样显示的

guni:gunicorn                    FATAL     can't find command 
'/home/ubuntu/myvenv/js/bin/gunicorn'
Run Code Online (Sandbox Code Playgroud)

我的 gunicorn conf 是这样的

[program:gunicorn]
directory=/home/ubuntu/js/main_jntu
command=/home/ubuntu/myvenv/js/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/js/app.sock 
main_jntu.wsgi:application
autostart=true
autorestart=true
stderr_logfile=/var/log/gunicorn/gunicorn.err.log
stdout_logfile=/var/log/gunicorn/gunicorn.out.log
[group:guni]
programs:gunicorn
Run Code Online (Sandbox Code Playgroud)

在此之后,当我检查状态时,它显示了这样的错误

guni:gunicorn                    FATAL     can't find command 
'/home/ubuntu/myvenv/js/bin/gunicorn'
Run Code Online (Sandbox Code Playgroud)

Put*_*M S 6

安装 gunicorn 后使用以下命令

whereis gunicorn
Run Code Online (Sandbox Code Playgroud)

它将给出 gunicorn 所在的确切路径,然后在您的 gunicorn conf 文件中使用该路径。快乐编码!!


Abh*_*rti 2

我认为问题出在配置文件的第三行。该错误消息表明gunicorn可执行文件在目录中不可用/home/ubuntu/myvenv/js/bin。如果这样做,ls /home/ubuntu/myvenv/js/bin/gunicorn您可能会收到一条错误消息。

我认为您需要检查是否已正确安装gunicorn在虚拟环境中,例如使用pip install gunicorn. 看看这篇文章;我认为这会有帮助。