小编Rah*_*rma的帖子

gunicorn ImportError:没有名为flask的模块

我有一个 anaconda 虚拟环境,当我运行我的应用程序时,我已经使用 pip 在虚拟环境中安装了 Flask

$ python app.py 
Run Code Online (Sandbox Code Playgroud)

然后它工作正常,但是当我用 gunicorn 运行它时,我没有显示没有模块烧瓶
app.py

$ python app.py 
Run Code Online (Sandbox Code Playgroud)

wsgi.py

from flask import Flask

app = Flask(__name__)

@app.route('/')
def index():
    return "Hello World"

if __name__ == '__main__':
    app.run(debug=True)
Run Code Online (Sandbox Code Playgroud)
 $ gunicorn --bind 0.0.0.0:8000 wsgi
[2019-07-23 12:39:24 +0000] [25612] [INFO] Starting gunicorn 19.9.0
[2019-07-23 12:39:24 +0000] [25612] [INFO] Listening at: http://0.0.0.0:8000 (25612)
[2019-07-23 12:39:24 +0000] [25612] [INFO] Using worker: sync
[2019-07-23 12:39:24 +0000] [25616] [INFO] Booting worker with pid: 25616
[2019-07-23 12:39:24 +0000] [25616] [ERROR] …
Run Code Online (Sandbox Code Playgroud)

python flask python-2.7

5
推荐指数
1
解决办法
2112
查看次数

标签 统计

flask ×1

python ×1

python-2.7 ×1