Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

"timed out waiting for debuggee to spawn" when using venv with debugger #1991

Closed
sbillin opened this issue Dec 13, 2019 · 6 comments
Closed

Comments

@sbillin
Copy link

sbillin commented Dec 13, 2019

Environment data

  • VS Code version: 1.41.0
  • Extension version (available under the Extensions sidebar): 2019.11.50794 (22 November 2019)
  • OS and version: Windows 10 Enterprise, Version 1809, OS build 17763.864
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.5
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version vscode-python#3977):

Expected behaviour

HelloWorld.py should run and print "Hello" to terminal when running Debugger

Actual behaviour

Pop-up window appears stating "Session-1 timed out waiting for debuggee to spawn"

Steps to reproduce:

Steps to create error:

  1. Create venv using Python 3.7.5
  2. Create simple program: print("hello")
  3. Run Debugger on simple program
  4. Pop-up window appears stating error shown below

VSCodeError

The following do work however and do not produce an error:
A. Running with Debugger using system Python 3.7.5 (i.e., not using venv)
B. Running without Debugger using venv (by clicking green triangle in upper-right corner of VS Code window). The output for this is shown below:

VSCode_Without_Debugger

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'Reload - control'
> conda --version
> pyenv root
> python3.7 -c "import sys;print(sys.executable)"
> python3.6 -c "import sys;print(sys.executable)"
> python3 -c "import sys;print(sys.executable)"
> python2 -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> py -3.7 -c "import sys;print(sys.executable)"
> py -3.6 -c "import sys;print(sys.executable)"
> py -3 -c "import sys;print(sys.executable)"
> py -2 -c "import sys;print(sys.executable)"
> C:\workspace\L2M\venv_L2M\Scripts\python.exe -c "import sys;print(sys.executable)"
> conda info --json
Starting Microsoft Python language server.
> conda --version

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

Nothing displayed
@brettcannon brettcannon transferred this issue from microsoft/vscode-python Dec 16, 2019
@int19h
Copy link
Contributor

int19h commented Dec 16, 2019

This is a dup of #1930. We already have a fix for this, but the version of ptvsd with the fix hasn't shipped yet.

In the meantime, you can work around this by copying python.exe from your global Python installation into the venv Scripts folder, replacing the stub that is already there.

Alternatively, you can opt out of ptvsd 5 by disabling Python -> Experiments: Enabled in VSCode settings.

@int19h int19h closed this as completed Dec 16, 2019
@normanmanulife
Copy link

Disable settings anything Python "Experiments: Enabled in VSCode" works for me

@alexdauenhauer
Copy link

I am having this issue when using the Remote-SSH extension. I am remoted into a server, trying to use debugger. My virtual env is a conda env if that matters. I disabled Python Experiments Enabled and this did not resolve my issue.

@int19h
Copy link
Contributor

int19h commented Jun 5, 2020

@alexdauenhauer Can you please file a separate bug, and describe your environment, repro steps, and the outcome in more detail? We have fixed the original root cause, so it's likely something else that will need to be investigated separately.

@DTKx
Copy link

DTKx commented Jun 6, 2020

Hello @int19h !

Sorry to bother, but I am just trying to change form Spyder to VS and I was checking out potential things to try to solve the same issue, however I am quite new to python and i could not follow your explanation of:
"copying python.exe from your global Python installation into the venv Scripts folder, replacing the stub that is already there."
Is there any documentation available that I can use to follow?

Thanks!

@int19h
Copy link
Contributor

int19h commented Jun 7, 2020

@DTKx It was a workaround for a specific issue that we have since fixed; you don't need to follow it if you have the most recent version of Python extension for VSCode. If you're seeing the "timed out" error message in the most recent version, can you please file a separate issue, and describe your symptoms in more detail?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants