python - supervisor控制台运行出错,BACKOFF Exited too quickly
PHPz
PHPz 2017-04-17 17:31:35
0
4
1317

运行系统为Ubuntu15,虚拟环境已激活,相关依赖包已安装程序正常运行;但外部环境没有安装相关依赖。
这是配置文件说明

这是配置命令

这是配置文件内容。

程序正常运行

启动控制台时出现错误:BACKOFF Exited too quickly (process log may have details).

错误日志

命令执行历史

============================================
将激活虚拟环境的命令加入supervisor command中

can't find command 'source'

==============================
在外部环境中安装flask,程序正常运行

启动控制台时出现错误:BACKOFF Exited too quickly (process log may have details).

对应错误日志

==============================
app.py源码

from flask import Flask
app=Flask(__name__)
@app.route('/')
def index():
return "Hello World"
if __name__=="__main__":
app.run(port=8080)

PHPz
PHPz

学习是最好的投资!

reply all(4)
Ty80

Thank you everyone for your answers.
It has been solved. You need to import the flask path in the virtual environment. Here is export PYTHONPATH=$PYTHONPATH:/root/FlaskWebDevelopment/venv/lib/python2.7/site-packages;
This is the stackoverflow answer address: http:/ /stackoverflow.com/questions/24188...
See link to first answer

小葫芦

You can configure the log of [program:app] first, and then determine from the log the specific reason why it failed to start successfully.
The log configuration is as follows:

[program:app]
stdout_logfile=/path/app.log
stderr_logfile=/path/app.log
刘奇

Use an absolute path for source, and virtualenv is not active, causing the python environment that your command runs to not have flask installed.

伊谢尔伦

Original, import flask failed, check if flask is installed
pip install flask

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template