-
Notifications
You must be signed in to change notification settings - Fork 67
Launching module with --nodebug breaks imports #745
Comments
Can you try this configuration? {
"name": "Module: foo",
"type": "pythonExperimental",
"request": "launch",
"console": "integratedTerminal",
"module": "foo",
"cwd": "${workspaceFolder}",
"env": {"PYTHONPATH": "${workspaceFolder}"}
}, |
Fails with the same error. |
Can you try it with an empty |
I did, same issue. |
Can you tell me the version of |
I'm using 4.1.1a10, which ships with the current version of vscode. Actually I'd like to clarify that the configuration you gave above (with To add some motivation for this bug, I found it when working on a Django app, which internally uses some wonky imports that break when running ptvsd in nodebug mode. |
With the configuration i gave it should work if you have |
This is not a bug -- things are working as expected. i.e.: if you have a structure such as the one below where
As a note, I suggest you don't use relative imports on this case, only full imports (because if it's a relative import it won't work unless python is executed with the |
Regardless of how you feel imports should be done, the fact remains that Incidentally, I agree that |
Note that it'll fail in the command line if -- Python itself appears to be executing |
My project structure is
bar.py
is an empty file.__main__.py
contains the single statementimport bar
. Mylaunch.json
configuration isRunning in debug mode causes the program to immediately terminate successfully, as expected. With
--nodebug
the program crashes with aModuleNotFoundError
exception complaining that there is no module named bar.I am running
ptvsd
in VSCode with Python3.6 on Ubuntu 18.04.The text was updated successfully, but these errors were encountered: