'Building a uwsgi plugin for python 3.9 failed for older version it works. Are there any other options?

i downloaded the latest source code uwsgi-2.0.19.1 and tried to build a uwsgi plugin for python 3.9 but it failed every time. For other Versions like python3.6 or python3.8 it works and i used them in other Django Projects. For Example...

Here it works:


Command:

[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"

Output:

*** 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 ***

Command:

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

Output:

*** 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 ***

Here it fails:


"Datei oder Verzeichnis nicht gefunden" is german and means "File or directory not found".

command:

[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 ***

Question:


  • Does it mean python3.9 is not supported? Could not find anything in the uWSGI docs, maybe i missed it.
  • Can i download somewhere a already build plugin for python3.9 ? I am not allowed to sudo apt install anything because i am on a shared Server.


Solution 1:[1]

hope this helps someone else that comes along a similar issue. my problem was uwsgi using always python3.8 when i wanted it to use python3.9 (apt installs and pip3, etc. nothing worked, i couldn't get the python3.9 plugin for uwsgi)

my solution was to install python3.9-dev

$ sudo apt install python3.9-dev

instead of just 'python3.9'

then $ python3 -m pip uninstall uwsgi

and finally $ python3 -m pip install --no-cache-dir uwsgi

this apparently included the uwsgi python3.9 plugin required, while ensuring that i removed any cached python3.8 stuff in apt glhf!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman