我下载了最新的源代码uwsgi-2.0.19.1,并试图为python 3.9构建一个uwsgi插件,但每次都失败了。对于其他版本,如python3.6或python3.8,它可以工作,我在其他Django项目中使用了它们。例如..。
这里工作:
命令:
[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"输出:
*** 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 ***命令:
[user@me /uwsgi-2.0.19.1] $ PYTHON=python3.8 ./uwsgi --build-plugin "plugins/python python38"输出:
*** 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“是德语,意思是”文件或目录未找到“。
命令:
[user@me /uwsgi-2.0.19.1] $ PYTHON=python3.9 ./uwsgi --build-plugin "plugins/python python39"outpu:
*** 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任何东西,因为我在共享服务器上.发布于 2022-01-29 00:00:44
好的。因此,我怀疑uwsgi-2.0.19.1版本不支持python 3.9是对的。使用最新或更新的uwsgi版本,我可以为python 3.9创建一个插件。
发布于 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!
https://stackoverflow.com/questions/68413988
复制相似问题