uWSGI和Python>3.4 [英] uWSGI and Python > 3.4

查看:76
本文介绍了uWSGI和Python>3.4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个django项目,当前正在使用以下配置运行:

I have a django project currently running with the following configuration:

  • Debian 8
  • Python 3.4
  • 皇帝模式下的uWSGI

我从源代码安装了Python 3.6.1,并使用python 3.6创建了一个新的虚拟环境(我使用virtualenvwrapper),但是让该项目以uwsgi开头似乎有点麻烦.

I installed Python 3.6.1 from source and created a new virtual environment with python 3.6 (I use virtualenvwrapper), but I seem to have some trouble getting the project to start up with uwsgi.

配置文件如下:

[uwsgi]
plugins = python3
project = %n
module = myapp.wsgi:application
home = path_to_new_env
socket = /var/run/uwsgi-%n.sock
chdir = path_to_new_env/myapp/myapp
processes = 4
max-requests = 5000
chmod-socket = 666
chown-socket = user:user
master = True
vacuum = True
logto = /var/log/%n_LOG.log
buffer-size = 32768

给我的印象是 python3 插件将包括对python 3.6的支持,但是日志表明仍在使用Python 3.4.x解释器.

I was under the impression that the python3 plugin would include support for python 3.6, but the log indicates that the Python 3.4.x interpreter is still being used.

在已安装的uwsgi插件列表中,我看到了对python 2、3和3.4的支持,但仅此而已.我不确定在启动时设置正确的解释器需要做什么.

In my list of installed uwsgi plugins, I see support for python 2, 3 and 3.4 but nothing more. I'm not sure what needs to be done to have the correct interpreter set on startup.

任何建议将不胜感激.

更新:我已经尝试为python 3.6构建uwsgi插件:

UPDATE: I've tried building a uwsgi plugin for python 3.6:

root@app:~# PYTHON=python3.6 uwsgi --build-plugin "/root/uwsgi-2.0.15/plugins/python python36"
*** uWSGI building and linking plugin from /root/uwsgi-2.0.15/plugins/python ***
[gcc -pthread] python36_plugin.so
/root/uwsgi-2.0.15/plugins/python/python_plugin.c: In function ‘uwsgi_python_atexit’:
/root/uwsgi-2.0.15/plugins/python/python_plugin.c:380:11: error: ‘struct uwsgi_server’ has no member named ‘skip_atexit_teardown’
  if (uwsgi.skip_atexit_teardown)
           ^
/root/uwsgi-2.0.15/plugins/python/python_plugin.c: At top level:
/root/uwsgi-2.0.15/plugins/python/python_plugin.c:2018:2: error: unknown field ‘worker’ specified in initializer
  .worker = uwsgi_python_worker,
  ^
/root/uwsgi-2.0.15/plugins/python/python_plugin.c:2018:2: error: initialization from incompatible pointer type [-Werror]
/root/uwsgi-2.0.15/plugins/python/python_plugin.c:2018:2: error: (near initialization for ‘python36_plugin.exception_class’) [-Werror]
/root/uwsgi-2.0.15/plugins/python/python_plugin.c:2018:2: error: initialized field overwritten [-Werror=override-init]
/root/uwsgi-2.0.15/plugins/python/python_plugin.c:2018:2: error: (near initialization for ‘python36_plugin.exception_class’) [-Werror=override-init]
cc1: all warnings being treated as errors
/root/uwsgi-2.0.15/plugins/python/uwsgi_pymodule.c: In function ‘py_uwsgi_spooler_get_task’:
/root/uwsgi-2.0.15/plugins/python/uwsgi_pymodule.c:2107:2: error: implicit declaration of function ‘uwsgi_spooler_read_header’ [-Werror=implicit-function-declaration]
  if (uwsgi_spooler_read_header(task_path, spool_fd, &uh) ||
  ^
/root/uwsgi-2.0.15/plugins/python/uwsgi_pymodule.c:2108:3: error: implicit declaration of function ‘uwsgi_spooler_read_content’ [-Werror=implicit-function-declaration]
   uwsgi_spooler_read_content(spool_fd, spool_buf, &body, &body_len, &uh, &task_stat)) {
   ^
cc1: all warnings being treated as errors
*** unable to build python36 plugin ***

推荐答案

我最近想出了使用

此处.

Mimic this process for any other python version you'd like to have available on the uwsgi server.
More help here.

这篇关于uWSGI和Python>3.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆