Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Time out waiting for launcher to connect in VS code

I did python debugging in VS code.
The following is the launch.json file:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "stopOnEntry": false,
            "python": "${command:python.interpreterPath}",
            "program": "${file}",
            "cwd": "${workspaceFolder}",
            "env": {},
            "envFile": "${workspaceFolder}/.env",
            "debugOptions":[
                "RedirectOutput"
            ],
            "console": "integratedTerminal"
        }
    ]
}

The following is settings.json file:

{
    "python.pythonPath": "c:\\Users\\susan\\Documents\\PythonScripts\\venv\\Scripts\\python.exe",
    // to fix 'Timeout waiting for debugger connections'
    "python.terminal.activateEnvironment" : false
}

When I debug the python script in VS code, I got Time out waiting for launcher to connect and cannot debug the python script.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

May I know how can I solve this issue?

>Solution :

Its very simple. Open the launch.json file and add the following into it:

{
  "name": "Python: Debug Console",
  "type": "python",
  "request": "launch",
  "program": "${file}",
  "console": "internalConsole"
}

Then save and exit it. Whatever you do, DO NOT clear the text already in there or else it may make it worser

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading