2

When debugging my code, my breakpoints are ignored by visual studio code, once I use these lines of code:

from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds
from brainflow.data_filter import DataFilter, FilterTypes, DetrendOperations, AggOperations

No error Message is given. I edited my launch.json in accordance to this post: Debugger Not Stopping at Breakpoints in VS Code for Python

And tried several others, but nothing solves my issue. Probably my import is wrong/has an error? (if anybody knows something brainflow specific, please let me know. First time using it so.. yeah...)

Here my Minimal Code example:

#Bt_Connection
#python -m pip install brainflow
#pip install pybluez
#python.exe -m pip install --upgrade pip

import argparse
import time
import socket
import os

from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds
from brainflow.data_filter import DataFilter, FilterTypes, DetrendOperations, AggOperations

msg="X"
print(msg)

test= "test"
print(test)

And some screenshots since the error really only becomes visible in the IDE. (Video would be better, but you have to believe me that the breakpoints are not hit.) enter image description here

enter image description here

In the second picture the code only stops at the first line, since that is specified in my launch.json. But once I hit continue it just goes through the code without stoping and writes "X" and "test" in the terminal.

launch.json for completions sake:

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

Python Version: 3.11.2 64 bit

And for Visual Studio Code:

enter image description here

G.M
  • 345
  • 3
  • 22
  • This has something to do with the python version. I used python 3.11 and python 3.10 for testing, and found the same problem with python 3.11, but with python 3.10 No problem. – JialeDu May 02 '23 at 07:59
  • True, I installed Python 3.10.10 and it works just fine... Thanks that really solves my issue for now. Off topic: that feels like a (maybe major) error on pythons part here. Or is there any reason to this? seems at least less user friendly. – G.M May 02 '23 at 08:16
  • Thanks, done so. If you find my question sufficiently well, please consider hitting the upvote, so more people can find it. ( I have seen a few threads with similar issues, but never this solution, so i guess this would be a good thing for others) – G.M May 02 '23 at 08:39

1 Answers1

1

It has something to do with your python version. Using the python 3.10 version you will get the desired effect.

Report it on GitHub: https://github.com/microsoft/debugpy/issues/1284

JialeDu
  • 6,021
  • 2
  • 5
  • 24