-
Notifications
You must be signed in to change notification settings - Fork 67
How to correctly set specific module to debug in VS code? #2088
Comments
launch.json:
|
how do I find the PTVSD version? |
Ah, I see the problem. You're using "module", but then specifying the path to the file - it should be a fully qualified module name instead. Or if you really do want to start it as a file, then it must be "program" rather than "module". Basically, this: "program": "foo/bar.py" is as if you did this from command line:
and this: "module": "foo.bar" is as if you did:
Note that in the latter case, you're also responsible for ensuring that the current directory and/or |
how do you have VS code fill in for your home path? i.e. if I had ~/foo/main.py, how can I have VS code fill for ~? |
You should pick the one that is most appropriate to your use case. Based on the configuration you've show, it sounds like "Python File" will work better for you. You can edit launch.json afterwards so that it always starts a particular named file, instead of the currently selected one. Here is the list of all variable substitutions that can be done in launch.json. I don't think there's anything specifically for |
I get an error:
code:
thanks for the help btw. |
works, dont forget the money sign!
|
Environment data
Version: 1.42.1
Commit: c47d83b293181d9be64f27ff093689e8e7aed054
Date: 2020-02-11T14:44:27.652Z
Electron: 6.1.6
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.3.0
Actual behavior
Does nothing
Expected behavior
Run the file I said no matter what file I am on.
Steps to reproduce:
I was following the instruction by VS code's website but it seemed that nothing that I tried worked.
I created a new configuration as required but whenever I put the path it refuses to work in VS code although the path VS code complains about in the integrated terminal window works fine when I call it manually.
The error the debugger throws is the following:
then I tried running the file it complains manually and it runs it just fine...
even when I hover over the path name and click it with
command + click
then it takes me to the path from within VS code. Which seems bizzare. So somehow only when I run it in debugger mode does it not work. Why?Cross-posted:
https://stackoverflow.com/questions/60215436/how-to-correctly-set-specific-module-to-debug-in-vs-code
The text was updated successfully, but these errors were encountered: