首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为python3.9构建一个uwsgi插件,对于旧版本,它是失败的。还有其他选择吗?

为python3.9构建一个uwsgi插件,对于旧版本,它是失败的。还有其他选择吗?
EN

Stack Overflow用户
提问于 2021-07-16 18:49:24
回答 2查看 1.2K关注 0票数 0

我下载了最新的源代码uwsgi-2.0.19.1,并试图为python 3.9构建一个uwsgi插件,但每次都失败了。对于其他版本,如python3.6python3.8,它可以工作,我在其他Django项目中使用了它们。例如..。

这里工作:

命令:

代码语言:javascript
复制
[user@me /uwsgi-2.0.19.1] $ make PROFILE=nolang

[user@me /uwsgi-2.0.19.1] $ PYTHON=python3.6 ./uwsgi --build-plugin "plugins/python python36"

输出:

代码语言:javascript
复制
*** uWSGI building and linking plugin from plugins/python ***
[gcc -pthread] python36_plugin.so
build time: 5 seconds
*** python36 plugin built and available in python36_plugin.so ***

命令:

代码语言:javascript
复制
[user@me /uwsgi-2.0.19.1] $ PYTHON=python3.8 ./uwsgi --build-plugin "plugins/python python38"

输出:

代码语言:javascript
复制
*** uWSGI building and linking plugin from plugins/python ***
[gcc -pthread] python38_plugin.so
build time: 5 seconds
*** python38 plugin built and available in python38_plugin.so ***

在这里失败了:

"Datei oder Verzeichnis nicht gefunden“是德语,意思是”文件或目录未找到“。

命令:

代码语言:javascript
复制
[user@me /uwsgi-2.0.19.1] $ PYTHON=python3.9 ./uwsgi --build-plugin "plugins/python python39"

outpu:

代码语言:javascript
复制
*** uWSGI building and linking plugin from plugins/python ***
[gcc -pthread] python39_plugin.so
In file included from plugins/python/python_plugin.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/pyutils.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/pyloader.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/wsgi_handlers.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/wsgi_headers.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/wsgi_subhandler.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/web3_subhandler.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/pump_subhandler.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/gil.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/uwsgi_pymodule.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/profiler.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/symimporter.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/tracebacker.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
In file included from plugins/python/raw.c:1:
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden
    2 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
*** unable to build python39 plugin ***

问题:

  • 是否意味着python3.9不受支持?在uWSGI文档中找不到任何东西,也许我错过了它。
  • 我可以下载一个已经为python3.9构建的插件吗?我不允许sudo apt install任何东西,因为我在共享服务器上.
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-01-29 00:00:44

好的。因此,我怀疑uwsgi-2.0.19.1版本不支持python 3.9是对的。使用最新或更新的uwsgi版本,我可以为python 3.9创建一个插件。

票数 1
EN

Stack Overflow用户

发布于 2022-02-12 03:48:00

希望这能帮助其他人解决类似的问题。我的问题是uwsgi总是使用python3.8,当我希望它使用python3.9 (apt安装和pip3等)时,没有什么工作,我无法为uwsgi获得python3.9插件)

我的解决方案是安装python3.9-dev

$ sudo apt install python3.9-dev

而不是仅仅是'python3.9‘

然后是$ python3 -m pip uninstall uwsgi

最后是$ python3 -m pip install --no-cache-dir uwsgi

这显然包括所需的uwsgi python3.9插件,同时确保我删除了apt glhf中任何缓存的python3.8!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68413988

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档