Update:
I just discovered that with a python 3.7 environment created with Anaconda
(version number 4.11.0, which creates a python 3.7.11), this problem happens while python 3.8(.12) created by conda doesn't have this kind of problem.
And I found a solution: I use integratedTerminal
in the launch.json, and without specifying terminal type, the default integrated terminal would be PowerShell
which has this problem. After I change the terminal.integrated.shell.Windows
setting to cmd.exe, this porlbem goes away and the problem goes through.
Original post:
I am developing a python 3.7 application on vs-code
on Windows. I am using Anaconda to manage my working environments (and I have created several evns on the same dev machine). The env I am using for this app is called basic_env
which is of version 3.7.10. Previously it was working fine. But today, when I returned from my 10-day holiday, and after I upgraded the vscode (to 1.64.0
) and probably the python extension (version v2022.0.1786462952
). The launching/debugging stopped working: a window popped up with an error mesage Timed out waiting for debuggee to spawn
. I made a simple test python script using the same conda env. My script is only one line
print("test....")
And my launch.json looks like this:
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"env": {
"PYTHONPATH": "${workspaceFolder}"
},
},
The same error showed up.
I tried to google this issue, at first I thought this post was the same as my problem: using venv caused this problem, and using the system-global python didn't have this problem. So maybe the bug which was fixed 2 years ago was back along with the updates? But then I tried some other conda envs, some worked and some didn't (but none of them was of version 3.7.10). I tried to upgrade this env to 3.7.11 by:
conda activate basic_env
conda install python=3.7.11
(other existing 3.7.11 envs work fine) but the problem was still there. Also, I don't know how to get the ptvsd.adapter log file in the mentioned post. Could anyone help me track this problem?
Thank you very much!
Cheers