Python编程:uWSGI配置报错ModuleNotFoundError: No module named 'flask'
【摘要】 flask的uwsig.ini配置文件如下:
[uwsgi]
socket = 127.0.0.1:3031
wsgi-file = flask_web.py
callable = app
processes = 4
threads = 2
stats = 127.0.0.1:9191
12345678
启动
$ uwsgi uwsig.ini1
然后报错: ...
flask的uwsig.ini
配置文件如下:
[uwsgi]
socket = 127.0.0.1:3031
wsgi-file = flask_web.py
callable = app
processes = 4
threads = 2
stats = 127.0.0.1:9191
启动
$ uwsgi uwsig.ini
然后报错:
Traceback (most recent call last):
File "flask_web.py", line 8, in <module> from flask import Flask
ModuleNotFoundError: No module named 'flask'
unable to load app 0 (mountpoint='') (callable not found or import error)
很明显是环境没有指定
[uwsgi]
socket = 127.0.0.1:3031
home = /Users/qmp/.virtualenvs/py3
wsgi-file = flask_web.py
callable = app
processes = 4
threads = 2
stats = 127.0.0.1:9191
指定环境参数home
后再次运行就成功了
也可以指定(四选一即可):virtualenv、venv、 home、 pyhome
参考:
文章来源: pengshiyu.blog.csdn.net,作者:彭世瑜,版权归原作者所有,如需转载,请联系作者。
原文链接:pengshiyu.blog.csdn.net/article/details/82594765
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)