Terrence Poe
Terrence Poe

Reputation: 644

A problem about VSCode for setting Python debuging

vs code version:1.29.1(1.29.1)

python version:3.6.5


Launch.json:

     {
        "name": "Python",
        "type": "python",
        "pythonPath":"${config.python.pythonPath}", 
        "request": "launch",
        "stopOnEntry": true,
        "console": "none",
        "program": "${file}",
        "cwd": "${workspaceRoot}",
        "debugOptions": [
            "WaitOnAbnormalExit",
            "WaitOnNormalExit",
            "RedirectOutput"
        ],
        "env": {"name":"value"}
    }

workspacesettings:

     {
"python.pythonPath": "/usr/local/opt/python/libexec/bin/python",
"python.linting.pylintEnabled": true
     }

Extensions I downloaded.


When I test for debugging, I got failed.

result


It's said "You need to select a Python interpreter before you start debugging". But I actually choice one version shows in the lower left corner.

Any part is incorrect?

Upvotes: 2

Views: 307

Answers (2)

Terrence Poe
Terrence Poe

Reputation: 644

I edit as the code below and it works!!

{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"stopOnEntry": true
}

Upvotes: 1

Sagun Raj Lage
Sagun Raj Lage

Reputation: 2494

The documentation that has been given here in the website of VS Code may be helpful. Did you try getting reference from here? https://code.visualstudio.com/docs/python/debugging

Upvotes: 0

Related Questions