Error following documentation to access camera from OpenCV. (linux headers I believe)

When I follow the documentation found here:

Section 2.2.1

I get an error that I don’t have python2 installed. After installing python2 and rerunning the script I get

*** SoC: BCM2711
Destination directory missing: /home/pi/5.15.32-v8+

Help: rpi-source/ at master · RPi-Distro/rpi-source · GitHub

I know this relates to the linux kernel/headers but I’ve been stuck here for days. Can anyone point me in the right direction?

It seems that you didn’t create the output directory?
mkdir $(uname -r)

One thing to note though, rpi-source seems to have stopped being updated, so accessing it with python3 may not be available on recent systems.