我能';不要装瓶子';在debian上正确使用uwsgi的s应用程序

我能';不要装瓶子';在debian上正确使用uwsgi的s应用程序,debian,virtualenv,uwsgi,bottle,Debian,Virtualenv,Uwsgi,Bottle,我正在尝试设置瓶子的应用程序 我在Debian 8(Jessie)上使用python2.7和3.4以及从APT安装的uwsgi。我当前的应用程序在python3.4下运行,为此我制作了一个VirtualEnv 当我重新加载uwsgi服务时出现问题,它没有在virtualenv中找到正确的模块。但是我在uwsgi.ini文件中有“virtualenv”条目 更新: 多亏了@Angel Velásquez,我修复了打字错误,但问题仍然存在 我看到uWSGI忽略了安装在virtualenv上的pyth

我正在尝试设置瓶子的应用程序

我在Debian 8(Jessie)上使用python2.7和3.4以及从APT安装的uwsgi。我当前的应用程序在python3.4下运行,为此我制作了一个VirtualEnv

当我重新加载uwsgi服务时出现问题,它没有在virtualenv中找到正确的模块。但是我在uwsgi.ini文件中有“virtualenv”条目

更新:

多亏了@Angel Velásquez,我修复了打字错误,但问题仍然存在

我看到uWSGI忽略了安装在virtualenv上的python版本,并尝试使用默认系统的python版本运行应用程序

我怎样才能让环境开始工作

config.ini

[uwsgi]
plugins = python3
virtualenv = /srv/virtualenv/donde
pythonpath = /srv/virtualenv/donde/lib/python3.4/site-packages
no-site = True

uid = www-data
gid = www-data
chdir = /srv/http/donde
file = app.py
processes = 2
threads = 2
[uwsgi]
plugins = python3
virualenv = /srv/virtualenv/donde
uid = www-data
gid = www-data
chdir = /srv/http/donde
file = app.py
processes = 2
threads = 2
[uwsgi]
plugins = python3
virualenv = /srv/virtualenv/donde

pythonpath = /srv/virtualenv/donde/lib/python3.4/site-packages

uid = www-data
gid = www-data
chdir = /srv/http/donde
file = app.py
processes = 2
threads = 2
输出

Sat Oct 17 23:35:30 2015 - added /srv/virtualenv/donde/lib/python3.4/site-packages/ to pythonpath.
Traceback (most recent call last):
  File "app.py", line 1, in <module>
    from bottle import Bottle, request, abort, template, static_file, jinja2_view
  File "/srv/virtualenv/donde/lib/python3.4/site-packages/bottle.py", line 16, in <module>
    from __future__ import with_statement
ImportError: No module named __future__
Sat Oct 17 23:35:30 2015 - unable to load app 0 (mountpoint='') (callable not found or import error)
输出:

Sat Oct 17 22:57:48 2015 - *** Operational MODE: preforking+threaded ***
Traceback (most recent call last):
  File "app.py", line 1, in <module>
    from bottle import Bottle, request, abort, template, static_file, jinja2_view
ImportError: No module named bottle
Sat Oct 17 22:57:48 2015 - unable to load app 0 (mountpoint='') (callable not found or import error)
Sat Oct 17 22:57:48 2015 - *** no app loaded. going in full dynamic mode ***
Sat Oct 17 22:57:48 2015 - *** uWSGI is running in multiple interpreter mode ***
Sat Oct 17 23:00:58 2015 - *** Operational MODE: preforking+threaded ***
Sat Oct 17 23:00:58 2015 - added /srv/virtualenv/donde/lib/python3.4/site-packages/ to pythonpath.
Sat Oct 17 23:00:58 2015 - WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0xce1000 pid: 19196 (default app)
Sat Oct 17 23:00:58 2015 - *** uWSGI is running in multiple interpreter mode ***
输出:

Sat Oct 17 22:57:48 2015 - *** Operational MODE: preforking+threaded ***
Traceback (most recent call last):
  File "app.py", line 1, in <module>
    from bottle import Bottle, request, abort, template, static_file, jinja2_view
ImportError: No module named bottle
Sat Oct 17 22:57:48 2015 - unable to load app 0 (mountpoint='') (callable not found or import error)
Sat Oct 17 22:57:48 2015 - *** no app loaded. going in full dynamic mode ***
Sat Oct 17 22:57:48 2015 - *** uWSGI is running in multiple interpreter mode ***
Sat Oct 17 23:00:58 2015 - *** Operational MODE: preforking+threaded ***
Sat Oct 17 23:00:58 2015 - added /srv/virtualenv/donde/lib/python3.4/site-packages/ to pythonpath.
Sat Oct 17 23:00:58 2015 - WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0xce1000 pid: 19196 (default app)
Sat Oct 17 23:00:58 2015 - *** uWSGI is running in multiple interpreter mode ***

似乎您的配置中有一个输入错误,它说的是virualenv而不是virtualenv

问题在安装uwsgi-plugin-python3后得到了解决:)

最后的config.ini如下所示

[uwsgi]
plugin = python3
virtualenv = /srv/virtualenv/donde

uid = www-data
gid = www-data
chdir = /srv/http/donde
file = app.py
processes = 2
threads = 2

哦,谢谢!但问题仍然存在!Python版本:2.7.9(默认值,2015年3月1日,13:01:26)[GCC 4.9.2]星期六2015年10月17日23:19:31-将PythonHome设置为/srv/virtualenv/donde importorror:没有名为site uWSGI的模块忽略virtualenv上的python3.4。添加“无站点”条目并不能解决问题,“导入恐怖:没有名为瓶子的模块”再次出现,我也有同样的问题,但安装了wsgi-plugin-python3。