1

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?

1 Answer 1

3

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, Python 3.6 stopped being supported by the extension mid 2022, so if your project still uses Python 3.6, the latest version of the debugger will silently not work.

So there are two ways to fix: either you update Python to a supported version (recommended), or if that's not possible then you can try downgrading the extension down to a version that still supports your outdated Python version.

To downgrade: click on Extensions (Ctrl+Shift+X), search for Python, click the options cog → Install another version..., and select an appropriate version (e.g. v2022.8.0 supports Python 3.6).

The options cog is at the bottom-right of the extension.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.