Flask conda env中使用主管和uwsgi的问题

Flask conda env中使用主管和uwsgi的问题,flask,uwsgi,supervisord,Flask,Uwsgi,Supervisord,我正在尝试使用uwsgi+supervisor+nginx运行Flask应用程序 uwsgi安装在conda env中,我可以在没有主管的情况下运行我的应用程序,也就是说,如果我运行(激活了我的conda env): 使用以下配置: /home/me/Development/flask/myflaskapp/myflaskapp.ini vim/etc/nginx/sites available/myflaskapp 现在,我创建一个管理器配置文件: /etc/supervisor/conf.d

我正在尝试使用uwsgi+supervisor+nginx运行Flask应用程序

uwsgi安装在conda env中,我可以在没有主管的情况下运行我的应用程序,也就是说,如果我运行(激活了我的conda env):

使用以下配置:

/home/me/Development/flask/myflaskapp/myflaskapp.ini

vim/etc/nginx/sites available/myflaskapp

现在,我创建一个管理器配置文件:

/etc/supervisor/conf.d/uwsgi-myflaskapp.conf

我使用启动supervisor(安装在系统范围内)

并用

sudo supervisorctl reload
但我在日志文件中发现以下错误:

ImportError: No module named wsgi
有什么建议吗

以下是完整的日志:

[uWSGI] getting INI configuration from /home/me/Development/flask/myflaskapp/myflaskapp.ini
*** Starting uWSGI 2.0.12 (64bit) on [Mon Jan 11 19:12:14 2016] ***
compiled with version: 4.8.4 on 11 January 2016 10:54:59
os: Linux-3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015
nodename: roquefort
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /
detected binary path: /home/me/Development/miniconda/envs/myflaskapp/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 63047
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /home/me/Development/flask/myflaskapp/run/myflaskapp.sock fd 3
Python version: 2.7.11 |Continuum Analytics, Inc.| (default, Dec  6 2015, 18:08:32)  [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x18001e0
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72760 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
ImportError: No module named wsgi
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 24671, cores: 1)

我在
/home/me/Development/flask/myflaskapp/myflaskapp.ini
中添加了wsgi.py文件的路径

chdir = /home/me/Development/flask/myflaskapp

这样它现在就可以找到wsgi了。

我在
/home/me/Development/flask/myflaskapp/myflaskapp.ini
中添加了wsgi.py文件的路径

chdir = /home/me/Development/flask/myflaskapp

因此,它现在可以找到wsgi。

如果您想指出基于此问题出现的新问题,请在评论中指出,而不是作为您答案的一部分。如您所见,这使得答案看起来像是一个新问题,这在本网站上是不允许的。如果您想指出一个基于此问题出现的新问题,请在评论中这样做,而不是作为您答案的一部分。正如你所看到的,这使得答案看起来像一个新问题,这在这个网站上是不允许的。
sudo supervisorctl reload
ImportError: No module named wsgi
[uWSGI] getting INI configuration from /home/me/Development/flask/myflaskapp/myflaskapp.ini
*** Starting uWSGI 2.0.12 (64bit) on [Mon Jan 11 19:12:14 2016] ***
compiled with version: 4.8.4 on 11 January 2016 10:54:59
os: Linux-3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015
nodename: roquefort
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /
detected binary path: /home/me/Development/miniconda/envs/myflaskapp/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 63047
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /home/me/Development/flask/myflaskapp/run/myflaskapp.sock fd 3
Python version: 2.7.11 |Continuum Analytics, Inc.| (default, Dec  6 2015, 18:08:32)  [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x18001e0
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72760 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
ImportError: No module named wsgi
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 24671, cores: 1)
chdir = /home/me/Development/flask/myflaskapp