-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spike - Use 'conda run' when debugging user code #8421
Comments
These notes are for the python debug adapter only.
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"pythonPath": "conda run" // <--- This is what you will have to add
} I need to confirm this from the debugger side that we will use |
I wouldn't use Today it's meant to point to the executable. |
We deprecated "pythonPath" in 5.x - it's just "python" now, and it can be an array to allow for arguments to the interpreter. In this case, I think it's reasonable to say that "conda" is the interpreter (and it doesn't have to be fully spelled out - indeed, we default to "python" if nothing is specified, it's just that VSC always specifies it in practice), and "run" is an argument to that interpreter. So, this should do the right thing, and take care of proper escaping etc: "python": ["conda", "run"] ("conda run" as a single value won't work, because it will be quoted as a single command-line argument when the launcher performs run-in-terminal or spawn.) |
Slight correction: if I'm understanding the docs right, you still need to tell Conda that you're running Python. So: "python": ["conda", "run", ..., "--", "python"] Where "..." is where environment name etc goes, as needed. |
Note, there's no |
Adding this for ease of reference:
|
Per the docs, |
Blocked on microsoft/ptvsd#1944 |
The error message above is because the extension itself injects "pythonPath" into the config, and ptvsd doesn't know which one it is supposed to use when it sees both. |
Yes, I corrected that. It's now blocked on the ptvsd issue. |
Looking at the logs on that debugger issue, the debuggee is being launched using
That is all the we want the extension to do, i.e., send the right launch configuration. The issue has been fixed and is available in |
debugger.vscode_b7868e94-7f63-49ed-a39b-85c511d76e0e.log I get the same error on |
@karrtikr It looks like it is still using 5.0.0a8 not master. You may have to delete the
The version looks like this when you install from master:
|
Not sure what was happening. But I deleted the directory multiple times and it's now using The prior error is gone now. The extension is sending the right launch configuration, but I was expecting to see Logsptvsd.adapter-12800.log |
Yep that is as expected. User code is actually running in using conda run if you see launcher.logs
|
The launcher itself gets launched using the same python executable as the |
Listed the findings of the spike in #8422 (comment). Closing the spike now. |
Use
conda run
when debugging user code, sequel to the conda run work in #7696.Modify the in-memory config (in the debug configuration resolver) to add 'conda run' if necessary, @karthiknadig is it only for launch or for both launch and attach?
The text was updated successfully, but these errors were encountered: