You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fairly straightforward issue. When performing "Start Debugging" or "Run Without Debugging", the debugger will use the current workspace interpreter instead of the interpreter specified in the launch.json configuration with the "python" key.
Steps to reproduce:
Have a multi-folder/root workspace. E.g.:
.vscode
launch.json
ProjectA
projecta-abcd-py3.x
etc
ProjectB
projectb-abcd-py3.x
etc
Specify the interpreter you want each debug configuration to use in your launch.json file. E.g.:
First, can you try specifying the absolute path instead of using the variable substitution when defining your python here "python": "${workspaceFolder}/ProjectB/projectb-abcd-py3.x/bin/python", and let me know what that does? Want to narrow down if this is an environment select issue or a variable substitution issue. Thanks!
Tested again with the absolute path for both "python" values in the launch.json, "python": "/home/REDACTED/projectA/projecta-abcd-py3.x/bin/python", and "python": "/home/REDACTED/ProjectB/projectb-abcd-py3.x/bin/python",.
The result was the same; The current workspace python interpreter is used instead of what's specified by the python config in the launch.json file.
Unrelated, but while testing this I noticed the python debug console terminal output no longer contains the first line from the examples in my original post, starting instead with the second of the three lines. This remained the case even after I reverted the launch.json file back to using the workspaceFolder variable, so I'm assuming the difference from before is due to an unrelated update or logging quirk.
The "source" commands were coming from the default python.terminal.activateEnvironment setting, which defaults to true. By configuring that setting to false, the first command that appears in python debugger terminals is now the /usr/bin/env /path/to/python/interpreter blah blah command.
It seems like whatever file is focused in your editor is affecting the python interpreter selection, seemingly preferring the interpreter for the workspace of whatever file you have focused when you Run/Debug.
Fairly straightforward issue. When performing "Start Debugging" or "Run Without Debugging", the debugger will use the current workspace interpreter instead of the interpreter specified in the launch.json configuration with the "python" key.
Steps to reproduce:
./projectA/projecta-abcd-py3.x/bin/python
.Expected result (terminal output):
Actual result (terminal output):
The text was updated successfully, but these errors were encountered: