Setting "justMyCode": false makes it stop at breakpoint:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Debug Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "stopOnEntry": true,
            "justMyCode": false
        },
    ]
}
Answer from Ashish on Stack Overflow
Discussions

json - Visual Studio Code Python debugger does not trigger breakpoints in subfolder files - Stack Overflow
I am using Visual Code 1.55.2 on Ubuntu 20.04 LTS. I have a simple problem, i.e. I cannot trigger breakpoints if they are in a subfolder of my project's one. This is my launch.json: { "ver... More on stackoverflow.com
🌐 stackoverflow.com
April 24, 2021
VS code not working for python debugging - Python - Code with Mosh Forum
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: More on forum.codewithmosh.com
🌐 forum.codewithmosh.com
0
June 24, 2022
Debugger not hitting breakpoint when using a virtual environment
Python extension for Visual Studio Code. Contribute to microsoft/vscode-python development by creating an account on GitHub. More on github.com
🌐 github.com
20
November 13, 2017
Breakpoints are not hitting in VS Code while debugging Python Flask app - Stack Overflow
VS code guys say they are working on it: https://github.com/Microsoft/vscode-python/issues/4355. So, for the moment, you should add the "no-reload" and "no-debugger" flags in the launch.json args section. More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
github.com › microsoft › vscode › issues › 120586
Debugger does not stop on breakpoints (python. VS code) · Issue #120586 · microsoft/vscode
April 5, 2021 - Whenever I try to add breakpoints to my python files, it marks it in the GUI as a breakpoint (red circle), but ignores them as if I never included them at all. The debugger just goes right over them without stopping. As a test I created ...
Author   PlanckBrain
🌐
Visual Studio Code
code.visualstudio.com › docs › python › debugging
Python debugging in VS Code
November 3, 2021 - Breakpoints can also be set to trigger based on expressions, hit counts, or a combination of both. The Python Debugger extension supports hit counts that are integers, in addition to integers preceded by the ==, >, >=, <, <=, and % operators.
🌐
Donjayamanne
donjayamanne.github.io › pythonVSCodeDocs › docs › troubleshooting_debugger
Debugger | Python in Visual Studio Code
Cause: The path to the python ... to the python executable in the launch.json Remember to re-start VS Code once done (this won’t be necessary in a future release). Cause: Invalid expressions in watch window The following error is displayed: Traceback (most recent call last): File ".../visualstudio_py_debugger.py", ...
🌐
Code with Mosh
forum.codewithmosh.com › python
VS code not working for python debugging - Python - Code with Mosh Forum
June 24, 2022 - I’ve been facing issues with using python extension with vs code for some weeks now. The debugging doesnt also work. Any help, please?🥲
Find elsewhere
🌐
GitHub
github.com › microsoft › vscode-python › issues › 109
Debugger not hitting breakpoint when using a virtual ...
November 13, 2017 - Debugger should break on breakpoints. ... { "version": "0.2.0", "configurations": [ { "name": "Python", "type": "python", "request": "launch", "stopOnEntry": true, "pythonPath": "/Users/george/Projects/TestVenv/bin/python", "program": "${file}", "cwd": "${workspaceRoot}", "env": {}, "envFile": "${workspaceRoot}/.env", "debugOptions": [ "WaitOnAbnormalExit", "WaitOnNormalExit", "RedirectOutput" ] } ] } Your settings.json: No settings.json file in the project.
Author   DonJayamanne
🌐
GitHub
github.com › microsoft › vscode-python › issues › 12593
Breakpoints not hit. · Issue #12593 · microsoft/vscode-python
June 26, 2020 - Issue Type: Bug I have a simple file parser in python and input text file. When I place a breakpoint at any line in the soure, the break point is not being hit. I set the break point at line pointed to here. Or at any line for that matte...
Author   sachinmyneni
🌐
GitHub
github.com › microsoft › vscode-python › issues › 4355
Breakpoints are not hitting in VS Code while debugging Python Flask app · Issue #4355 · microsoft/vscode-python
February 12, 2019 - https://code.visualstudio.com/docs/python/debugging · Repo for reference: https://github.com/iamshivprasad/analytics ... I am able to launch the program successfully with below settings in launch.json.
Author   iamshivprasad
🌐
GitHub
github.com › microsoft › vscode-python › issues › 4844
Debugger Doesn't Stop At Breakpoints · Issue #4844 · microsoft/vscode-python
March 20, 2019 - When VSCode is used to debug a Python 3.6 script I anticipate for the execution of the code to stop when a breakpoint is 'hit'. The code simply continues running as if the breakpoint wasn't there at all ... Open the .vscode/settings.json file and change the "python.pythonPath": variable from the previously selected interpretter to be .\\Scripts\\python.exe
Author   primalewden
🌐
Reddit
reddit.com › r/learnpython › breakpoints not working in visual studio community 2022
r/learnpython on Reddit: Breakpoints not working in Visual Studio Community 2022
May 22, 2022 -

I'm running the Visual Studio Community 2022 version. I'm attempting to use the debugger on a Python script, but there is an error notification next to my breakpoint which reads as follows:

The breakpoint will not currently be hit. Breakpoint in file excluded by filters

Note: may be excluded because of "justMyCode" option (default == true). Try setting "justMyCode": false in the debug configuration (e.g., launch.json)

I navigated to debug > options > general > just my code, and disabled the checkbox next to this. However, the same error message still occurs. Is there a launch.json file somewhere that needs to be edited as well?

EDIT

Here is some sample code that I have attempted to run using Visual Studio:

import os

def change_dirs(new_dir: str) -> str:
    os.chdir(new_dir) 
    return 'Current working directory is ' + new_dir

change_dirs(input('Please enter a directory to change to:\n'))

Here is a link to a screenshot that shows the above code, as well as the error message mentioned before.

And here is a link showing the "Just In Time" settings checkbox disabled. Even after disabling this setting and restarting the computer, the issue still persists.

EDIT 2:

Changed image links since imgur was not working

🌐
Reddit
reddit.com › r/learnprogramming › breakpoints not working in visual studio community 2022
r/learnprogramming on Reddit: Breakpoints not working in Visual Studio Community 2022
May 22, 2022 -

I'm running the Visual Studio Community 2022 version. I'm attempting to use the debugger on a Python script, but there is an error notification next to my breakpoint which reads as follows:

The breakpoint will not currently be hit. Breakpoint in file excluded by filters

Note: may be excluded because of "justMyCode" option (default == true). Try setting "justMyCode": false in the debug configuration (e.g., launch.json)

I navigated to debug > options > general > just my code, and disabled the checkbox next to this. However, the same error message still occurs. Is there a launch.json file somewhere that needs to be edited as well?

EDIT

Here is some sample code that I have attempted to run using Visual Studio:

import os

def change_dirs(new_dir: str) -> str:
    os.chdir(new_dir) 
    return 'Current working directory is ' + new_dir

change_dirs(input('Please enter a directory to change to:\n'))

Here is a link to a screenshot that shows the above code, as well as the error message mentioned before.

And here is a link showing the "Just In Time" settings checkbox disabled. Even after disabling this setting and restarting the computer, the issue still persists.

EDIT 2:

Changed image links since imgur was not working

🌐
GitHub
github.com › microsoft › vscode-python › issues › 1940
Python extension does not stop at breakpoints · Issue #1940 · microsoft/vscode-python
June 12, 2018 - From @shortjonescipher on June 12, 2018 7:39 Issue Type: Bug On any Python script, such as 'print("hello world")', the debugger does not stop on any enabled breakpoints, but runs the script until it terminates. The debug configuration is...
Author   RMacfarlane
🌐
GitHub
github.com › microsoft › debugpy › issues › 1596
VSCode python debugger does not go inside the third party library code even with justmycode set to false on 1.90 VS code · Issue #1596 · microsoft/debugpy
June 7, 2024 - Using VS Code or Visual Studio: VSCode · Python code: import yaml with open("./config/config.yml", "r") as f: data = yaml.safe_load(f) launch.json: { "version": "0.2.0", "configurations": [ { "name": "File", "type": "debugpy", "request": "launch", "program": "${file}", "console": "integratedTerminal", "justMyCode": false } ] } debug point at data = yaml.safe_load(f) I can ctrl+click and go inside yaml.safe_load() and set a breakpoint in that method but when debugging, the control remain in the my code and does not go inside the safe_load().
Author   uvnikgupta