• Community
  • Beginner - Debugging in Visual Studio

Sorry if this is a very noobie question, I would be willing to take this down if this is not the right place to ask.

What would be some recommended general strategies when it comes to debugging all the example Python files?

Take debugging spatial mobile net for example, one error I got is : module 'depthai' has no attribute 'Pipeline'

The only two changes I made are

  1. adding sys.path.append("/home/yuxiang/Desktop/code/depthAI")
  2. comment out import sys on line 22

Here's my launch.json


{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Module",
            "type": "python",
            "request": "launch",
            "module": "spatial_mobilenet",
            "justMyCode": true,
            "env": {
                "PYTHONPATH":"/home/yuxiang/Desktop/code/depthAI/" 
            }
        }
    ]
}

How would you get intellisense and autoComplete to work?
settings.json

{
    "python.analysis.extraPaths": ["/home/yuxiang/Desktop/code/depthAI"],
    "python.autoComplete.extraPaths": ["/home/yuxiang/Desktop/code/depthAI"]
}

Your help would be much appreciated!

Happy new year and enjoy your holidays!

  • erik replied to this.

    Hi YuxiangGuan ,
    I would suggest PyCharm, I have found that IDE much easier to work/debug with. I don't have much experience with VS Code debugging.
    Thanks, Erik