Missing config-3.py and config-3.8.py during installation from source

When configuring cmake what does the output say about your python version?
I suspect that I have a similar issue. Where opencv creates a build for the wrong version even when you specify the python version to build for.

Here is an example from my cmake output as you can see from the python3 interpreter I am trying to build opencv for python3.10, however cmake detects it as a version 3.8 and thus installs it accordingly. Thus you get the config-3.x is missing errors.

I know that this thread is kind of old, but could you check if you get the same behavior during building?

  Python 2:
    Interpreter:                 /usr/bin/python2.7 (ver 2.7.18)
    Libraries:                   /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.18)
    numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.16.5)
    install path:                lib/python2.7/dist-packages/cv2/python-2.7

  Python 3:
    Interpreter:                 /usr/local/bin/python3.10 (ver 3.8.10)
    Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.8.so (ver 3.8.10)
    numpy:                       /home/marius/.local/lib/python3.10/site-packages/numpy/core/include (ver 1.19.5)
    install path:                /home/marius/.local/lib/python3.10/site-packages/cv2/python-3.8

  Python (for build):            /usr/bin/python2.7