2

With an empty workspace settings (settings.json), I can use the classic python launch configuration to debug my file. For example:

{
  "name": "Launch",
  "type": "python",
  "request": "launch",
  "stopOnEntry": true,
  "pythonPath": "${config:python.pythonPath}",
  "program": "${workspaceRoot}/someFile.py",
  "cwd": "${workspaceRoot}",
  "env": {},
  "envFile": "${workspaceRoot}/.env",
  "debugOptions": [
    "WaitOnAbnormalExit",
    "WaitOnNormalExit",
    "RedirectOutput"
  ]
}

Great. Stepping thru code works excellent (osx python 2.7).

I have a virtual environment created. I ran virtualenv <vname>. All of my source lives in the <vname> dir, along with the bin, lib, etc folders that virtualenv created.

Now, I have set "python.pythonPath": "${workspaceRoot}/bin/python" in my VSCode settings (VSCode v1.16.0). The python executes, but debugger points are not honored.

What'd I do wrong? Thx!

0

2 Answers 2

1

Add below setting in launch.json file

"justMyCode": false,
Sign up to request clarification or add additional context in comments.

1 Comment

My god, thank you a lot. I spent more than 2 hours to find a problem, and finally it works.
0

Python path should be set:

"python.pythonPath": ${workspaceRoot}/<vname>/bin/python"

with <vname> is virtual environment directory, created by using virtualenv <vname>

1 Comment

as noted above, i moved my project files into <vname>. the code executes fine, it just doesn't break. are you suggesting that my convention is not permitted?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.