VS code not working for python debugging

I’ve been facing issues with using python extension with vs code for some weeks now. The debugging doesnt also work.

Any help, please?:smiling_face_with_tear:

I did not take the Python course not am I particularly into Python myself.
I checked if Python is installed and it happens to be.
So I gave it a try and created a Python file in VS Code.
Asked me to install the extension from Microsoft.
It works.

image

I searched a bit and it seems some version of Python have a bug.

I have Python 3.10.4 installed.

1 Like

Thank you soo much for the feedback. Can you kindly send me a picture of the python you have installed, please.

Also, I have been battling the below error for weeks now.

As I told I don’t code in Python so I removed it. But this was ms-python.python

Name: Python
Id: ms-python.python
Description: IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), Jupyter Notebooks, code formatting, refactoring, unit tests, and more.
Version: 2022.8.0
Publisher: Microsoft
VS Marketplace Link: Python - Visual Studio Marketplace

Never met those errors.
Don’t know for the first but the second seems to ask you to toggle a setting
Ctrl+Shift+P.

I checked and it is there.

Seems you can try Ctrl+Shift+I shortcut too.

1 Like

Python has a debugger , which is available as a module called pdb . It supports setting conditional breakpoints , stepping through the source code one line at a time, stack inspection, and more.

import pdb
msg = "this is a test"
pdb.set_trace()
print(msg)

Insert pdb.set_trace() anywhere and it will function as a breakpoint . When you execute the script by python test.py, you will in the python debug mode.