# VS code not working for python debugging

**URL:** <https://forum.codewithmosh.com/t/vs-code-not-working-for-python-debugging/13279>\
**Category:** Python\
**Created:** [June 24, 2022, 11:54pm UTC](https://forum.codewithmosh.com/t/vs-code-not-working-for-python-debugging/13279 "2022-06-24T23:54:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abzmoha](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/abzmoha/32/4001_2.png) [@Abzmoha](https://forum.codewithmosh.com/u/Abzmoha)\
**Post date:** [June 24, 2022, 11:54pm UTC](https://forum.codewithmosh.com/t/vs-code-not-working-for-python-debugging/13279/1 "2022-06-24T23:54:06Z")

</div>

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

Any help, please?🥲

---

<div class="post-metadata">

**Author:** ![UniqueNospaceShort](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/uniquenospaceshort/32/1814_2.png) [@UniqueNospaceShort](https://forum.codewithmosh.com/u/UniqueNospaceShort)\
**Post date:** [June 26, 2022, 12:20pm UTC](https://forum.codewithmosh.com/t/vs-code-not-working-for-python-debugging/13279/2 "2022-06-26T12:20:30Z")

</div>

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](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/4/4f05b41a5abf3d2c00b32e03b3a09817be0e7262.png)

I searched a bit and it seems [some version of Python have a bug](https://stackoverflow.com/questions/66035855/python-in-vs-code-not-stopping-at-breakpoints).

I have Python 3.10.4 installed.

---

<div class="post-metadata">

**Author:** ![Abzmoha](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/abzmoha/32/4001_2.png) [@Abzmoha](https://forum.codewithmosh.com/u/Abzmoha)\
**Post date:** [June 26, 2022, 12:45pm UTC](https://forum.codewithmosh.com/t/vs-code-not-working-for-python-debugging/13279/3 "2022-06-26T12:45:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Abzmoha](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/abzmoha/32/4001_2.png) [@Abzmoha](https://forum.codewithmosh.com/u/Abzmoha)\
**Post date:** [June 26, 2022, 12:49pm UTC](https://forum.codewithmosh.com/t/vs-code-not-working-for-python-debugging/13279/4 "2022-06-26T12:49:22Z")

</div>

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

 ![16562476721806677674802080975051](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/a/a122c93f1f58c1eb42507b75f7216e9df4e17398.jpeg)

---

<div class="post-metadata">

**Author:** ![UniqueNospaceShort](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/uniquenospaceshort/32/1814_2.png) [@UniqueNospaceShort](https://forum.codewithmosh.com/u/UniqueNospaceShort)\
**Post date:** [June 28, 2022, 8:26pm UTC](https://forum.codewithmosh.com/t/vs-code-not-working-for-python-debugging/13279/5 "2022-06-28T20:26:35Z")

</div>

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](https://marketplace.visualstudio.com/items?itemName=ms-python.python)

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.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/b/b50c82f5d8204064c6828330c97f38b8f5ba30fe.png)

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

---

<div class="post-metadata">

**Author:** ![doniervask](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@doniervask](https://forum.codewithmosh.com/u/doniervask)\
**Post date:** [January 13, 2023, 1:49am UTC](https://forum.codewithmosh.com/t/vs-code-not-working-for-python-debugging/13279/6 "2023-01-13T01:49:39Z")

</div>

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.

```auto
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](http://net-informations.com/python/iq/debug.htm) mode.

---

<div class="post-metadata">

**Author:** ![lsantamariarojas](https://avatars.discourse-cdn.com/v4/letter/l/c68b51/32.png) [@lsantamariarojas](https://forum.codewithmosh.com/u/lsantamariarojas)\
**Post date:** [August 8, 2023, 12:46am UTC](https://forum.codewithmosh.com/t/vs-code-not-working-for-python-debugging/13279/7 "2023-08-08T00:46:19Z")

</div>

Please see my solution here:

> [@Debugging is a big deal?](https://forum.codewithmosh.com/t/debugging-is-a-big-deal/13919/3):
>
> Ok, I wasted a fair bunch of hours trying to make it work with the way that the django videos suggests but it didn’t work for me. that included fiddling with the launch.json in so many different ways, running as admin, re installing vs code. My best guess is that the vscode project debugger is not picking up either the env or the interpreter correctly. Tried explicitly stating those in the launch.json and didn’t work either. My solution When starting the project don’t use pipenv in the way re…
