9

I have been using Visual Studio Code for a few years and I find it a really good IDE. I program in Python more than any other language.

It really bothers me that I did not get around to using the IDE's debugger (even though it's a feature).

Error when pressing the debug play button:

Failed to launch the Python Process, please validate the path 'export PATH=$PATH:/Library/Frameworks/Python.framework/Versions/2.7/bin/python'

Enter image description here

Checking my PYTHONPATH:

Enter image description here

My launch.json file:

"configurations": [
    {
        "name": "Python",
        "type": "python",
        "request": "launch",
        "stopOnEntry": true,
        "pythonPath": "${config:python.pythonPath}",
        "program": "${file}",
        "cwd": "/workspace/h5-automation/",
        "env": {},
        "envFile": "${workspaceRoot}/.env",
        "debugOptions": [
            "WaitOnAbnormalExit",
            "WaitOnNormalExit",
            "RedirectOutput"
        ]
    }

Any ideas / suggestions?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Lyle Henkeman
  • 391
  • 1
  • 3
  • 6

1 Answers1

-7

If you are on a *nix system, launch the terminal and type which python to get the Python path, copy it and paste it as the value of pythonPath in the launch.json file.

rubayeet
  • 9,269
  • 8
  • 46
  • 55
  • 1
    ```"configurations": [ { "name": "Python", "type": "python", "request": "launch", "stopOnEntry": true, "pythonPath": "/Library/Frameworks/Python.framework/Versions/2.7/bin/python", "program": "${file}", "cwd": "/workspace/h5-automation/", "env": {}, "envFile": "${workspaceRoot}/.env", "debugOptions": [ "WaitOnAbnormalExit", "WaitOnNormalExit", "RedirectOutput" ] },``` – Lyle Henkeman Dec 28 '17 at 15:25