运行系统为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)
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:
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