Reputation: 1538
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!
Upvotes: 2
Views: 878
Reputation: 501
Python path should be set:
"python.pythonPath": ${workspaceRoot}/<vname>/bin/python"
with <vname>
is virtual environment directory, created by using virtualenv <vname>
Upvotes: 0