Home > Software design >  VSCode Run -> Start Debugging Python with Launch.json Doesn't Run Anything
VSCode Run -> Start Debugging Python with Launch.json Doesn't Run Anything

Time:11-20

In Visual Studio Code, After setting up a launch.json for Python Flask, I got a file like this:

{
    // 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: Flask",
        "type": "python",
        "request": "launch",
        "module": "flask",
        "env": {
            "FLASK_APP": "app.py",
            "FLASK_DEBUG": "1"
        },
        "args": [
            "run",
            "--no-debugger",
            "--no-reload"
        ],
        "jinja": true,
        "justMyCode": true
    },
]

But when I try to run my project through the menu RunStart Debugging (F5), VSCode starts doing something and shows the debug bar (with pause/reload buttons), but a moment later the bar disappears without my projecting running at all, without even showing a terminal, printing logs, or giving any error message. How do I fix this?

CodePudding user response:

This can happen when the Python version of your project (e.g. used by venv) is no longer supported by the Python debugger installed as a VSCode Extension. For example, The options cog is at the bottom-right of the extension.

  • Related