When trying to debug python files from vscode, you might run into this error:
Reason & Solutions
One of the possible reason is that you are using PowerShell as the default terminal for the debugging.
If you have the Python extension installed, you should have got a notice about this:
You can just click the Use Command Prompt
button, then kill the current terminal and reopen it.
If you missed the notification, you could follow the steps below to change the default terminal from PowerShell to Command Prompt:
Ctrl + Shift + P
to open the command palette.- Type select default shell and hit Enter.
- Select Command Prompt.
- Kill all current terminals.
Ctrl + ~
to open the terminal.
Now the terminal should be command prompt and you could debug your python files.
Details
As of 11/12/2018, it had been confirmed by Brett Cannon 28 days ago that this is because there are some capability issues between conda and PowerShell, and this should be fixed in conda 4.6, before that, you could either change the terminal to command prompt or disable the environment activation.
Reference
https://github.com/Microsoft/vscode-python/issues/2732#issuecomment-429994915