Ask questions"launch" doesn't work with venv on Windows and Python 3.7+

<!-- Please search existing issues to avoid creating duplicates. -->

Environment data

  • VS Code version: 1.40.1
  • Extension version (available under the Extensions sidebar): 2019.11.49689
  • OS and version: Windows 10 Pro 1909
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.4
  • Type of virtual environment used: pipenv or poetry. Happens on both

Expected behaviour

Being able to debug the application

Actual behaviour

Popup shows message Session-1 timed out waiting for debuggee to spawn (debugee as it is written)

I have also noticed an odd behavior. Testing on 2 machines with the same setup, the terminal command for running the same program runs very differently.

Machine with the issue:

(.venv) PS C:\Repos\NMIND\CCP\transport\ccp-etl-adlib> & 'c:\Repos\NMIND\CCP\transport\ccp-etl-adlib\.venv\Scripts\python.exe' 'c:\Users\dudut\.vscode\extensions\ms-python.python-2019.11.49689\pythonFiles\lib\python\new_ptvsd\wheels\ptvsd\launcher' 'C:\Repos\NMIND\CCP\transport\ccp-etl-adlib/'

Machine without the issue:

(.venv) PS C:\Repos\NMind\CCP\transport\ccp-etl-adlib> cd 'c:\Repos\NMind\CCP\transport\ccp-etl-adlib'; ${env:PYTHONIOENCODING}='UTF-8'; ${env:PYTHONUNBUFFERED}='1'; & 'c:\Repos\NMind\CCP\transport\ccp-etl-adlib\.venv\Scripts\python.exe' 'c:\Users\vitco\.vscode\extensions\ms-python.python-2019.11.49689\pythonFiles\' '--default' '--client' '--host' 'localhost' '--port' '64361' 'C:\Repos\NMind\CCP\transport\ccp-etl-adlib/'

Steps to reproduce:

Even the simplest program wont debug if it is running from a virtual environment. Tried with or without activation. Tried running on CMD or PS. Tried running on integratedTerminal, externalTerminal, internalConsole. Tried running on poetry and pipenv. Reinstalled python and extension. Cleared all python, pipenv, virtualenv, poetry, and extension files and folders across the computer. All combinations failed.


terminal.txt settings.json launch.json ptvsd.launcher-7012.log ptvsd.adapter-8744.log debugger.vscode_482d787f-1202-4275-ad01-2e93f7e025ed.log ptvsd.server-13056.log


Answer questions vdurante

I will answer all 3 of your messages

  1. ok, that makes sense. Thank you
  2. yes. Everything works fine without environment. And the environments stopped working randomly. Environments were working yesterday
  3. I understood your description, but couldn't understand if this is a bug or something I did wrong

Thank you for the fast response

Github User Rank List