Install previous versions of the Python Debugger extension in VSCode.
How to debug Python 3.6 in VSCode?
gdb - Python extension debugging - Stack Overflow
VSC asks for a python debugger despite it already being installed
Videos
My Python debugger is broken (I am using Python 3.6, I can't change it because this isn't my project) since it only supports Python 3.7+. "The debugger in the python extension no longer supports python versions minor than 3.7."
I've heard that debugpy exists and theoretically supports Python 3.6, but I have no idea how to use it (how is it different from the base Python Debugger in vscode). I currently have Python Debugger v2024.0.0 installed, and its description is "Python Debugger extension using 'debugpy'" but it won't let me debug my Python 3.6 code. I tried installing an older version, but when I navigate to that option, it only shows me 2024.0.0 (current) and no other options. Seeing other people do it (with other extensions at least), they have hundreds of options, from like every single month.
I have no idea what to do, I don't use extensions besides the debugger so I have no idea what's going on. I turned off auto-updates and set it to manual, but I haven't been able to fix it.
Has anyone been able to debug Python 3.6 in VSCode, and if so, how?
For source debugging to work, your C extensions must be built with debug info (gcc -g). Since you're driving the compilation process with distutils, you can specify the compiler flags used through the CFLAGS environment variable (Installing Python Modules: Tweaking compiler/linker flags):
CFLAGS='-Wall -O0 -g' python setup.py build
Note that even if distutils defaults to a higher optimization level than -O0, you really shouldn't get that No symbol "node" in current context error as long as -g is passed and most Python builds do pass -g by default.
The problem is the optimization. I'm not sure how to do it from the command line, but in the setup.py script I just added extra_compile_args=['-O0'], to the Extension constructor and everything worked.
Would still like (and would accept) an answer that involved a command line arg (something after python setup.py build) that would accomplish the same thing so I don't have to have a compiler specific line in my setup.py file.