我正在尝试使用带有uwsgi和主管的conda env来运行Flask应用程序.
我设法解决了关于wsgi脚本路径的第一个问题,但我找不到如何设置conda env.
我的uwsgi配置文件/home/me/Development/flask/myflaskapp/myflaskapp.ini
是
[uwsgi] module = wsgi master = true process = 2 chmod-socket = 666 chdir = /home/me/Development/flask/myflaskapp socket = /home/me/Development/flask/myflaskapp/run/myflaskapp.sock callable = app vacuum = true
我的主管配置是
[program:uwsgi-myflaskapp] command=/home/me/Development/miniconda/envs/myflaskapp/bin/uwsgi /home/me/Development/flask/myflaskapp/myflaskapp.ini autostart=true autorestart=true stdout_logfile=/home/me/Development/flask/myflaskapp/log/uwsgi-myflaskapp.log redirect_stderr=true exitcodes=0
当我通过主管开始uwsgi时,我得到了
*** Operational MODE: single process *** Traceback (most recent call last): File "./wsgi.py", line 1, infrom myflaskapp import app File "./myflaskapp/__init__.py", line 1, in from flask import Flask ImportError: No module named flask
所以我想我没有设置conda env.我怎么设置它?