Click here to Skip to main content
15,791,892 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VS Code's Python debugger is not stopping at breakpoints. The issue began after modifying the launch.json file, notably the "justMyCode" setting.

System Information:

OS: macOS Monterey 13.1
Python: 3.10.12
VSCode Version:
Version: 1.81.1
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09
Electron: 22.3.18
Chromium: 108.0.5359.215
Node.js: 16.17.1
OS: Darwin arm64 22.2.0

This revised summary integrates the added information and is ready for submission.

What I have tried:

The debugger was functioning as expected before.
Editing the launch.json file seems to have triggered the issue.
The problem persists even on simple Python scripts.

Steps Taken to Resolve the Issue:

Confirmed "justMyCode" is set to true in launch.json.
Deleted and recreated launch.json.
Verified the file being debugged is a valid Python script.
Checked breakpoint placements.
Ensured the chosen debugger configuration is "Python: Current File".
Reset all Python-related settings in VS Code to default.
Checked the Python interpreter in use by VS Code.
Created a new VS Code workspace and attempted debugging in a fresh environment.
Examined the .vscode directories and their potential effect.
Reinstalled the Python extension for VS Code.
Successfully debugged outside of VS Code using pdb.
Despite these measures, the debugger continues to bypass breakpoints. Your assistance or further troubleshooting steps would be invaluable.

My questions:
  1. Has anyone else had this problem?
  2. Is there anything else I can try?

Note: As usual, ChatGPT is of no help, same as bard.

Updated 28-Aug-23 10:21am
Dave Kreskowiak 27-Aug-23 1:36am    
You may have screwed up the formatting of the json file and an option is not where it's supposed to be.

1 solution

I'd start by creating a new test project and confirming that the debugger works there.
If it does, then compare the two launch.json files and see if there are any differences. Back up your "real" project version, then modify it to match the working copy.

If that fixes the problem, fine. If it doesn't, then you best bet is MS tech support - they are pretty good and can dial into your system to look at the problem, which we can't.
Share this answer
John Draper 2023 27-Aug-23 4:16am    
I appreciate your response, thanx. What is the link to MS Tech support?
OriginalGriff 27-Aug-23 4:48am    
Oh, come on! You are joking, right?
John Draper 2023 28-Aug-23 15:43pm    
I have already tried to build a new project from scratch. It's just puzzling because it was working just fine until a made a single change to the json file launch.json that "broke" it, but when I changed it back, its still broken.
OriginalGriff 29-Aug-23 1:12am    
Clearly, you didn't make "just one change" - you may have accidentally deleted (or added) more than you think. JSON data is good, but it's vulnerable to "manual change" errors - it's very easy to mess us the whole file with a trivial change!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900