[Python] Debugging Python in Visual Studio Code from a WSL2 instance produces no output

Discussão em 'Python' iniciado por Stack, Março 18, 2025.

  1. Stack

    Stack Membro Participativo

    I'm on a Windows 10 (Build 19044) host machine and running an Ubuntu 18.04 instance in a WSL2 container. Using VS Code with the Microsoft Python extension installed.

    When I try to run or debug a python file in VS Code (pressing F5 while window with file is active) the "RUN AND DEBUG" view opens and nothing else happens - no output is produced and the code doesn't run.

    I've tried:

    • adding "python.defaultInterpreterPath" :"/usr/bin/python3 to my settings.json file
    • adding "linux": {"name": "Launch[linux]", "type": "python", "request": "launch", "program": "${file}"} to my launch.json file

    I can run the python scripts in the integrated terminal just fine. Currently out of ideas to try next. All guides online say it should just work.

    Continue reading...

Compartilhe esta Página