python-3.x - VS 代码 : "Property Debug Options Not Allowed"

标签 python-3.x visual-studio-code vscode-settings vscode-debugger

我正在尝试学习 Python 并设置 VS Code 的 Python 调试器,如该视频所述:https://www.lynda.com/Python-tutorials/Choosing-editor-IDE/661773/707220-4.html

但是,讲师似乎在使用 VS Code 1.18,而我在使用 1.28。我根据它在视频中的显示方式设置了 launch.json 配置,但是我在“debugOptions”下看到一条绿线,上面写着“不允许使用属性 debugOptions”。任何人都知道我可以如何设置我的环境,使其按照讲师解释的方式工作。我在 Windows 10 上。

{
// 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",
        "type": "python",
        "request": "launch",
        "stopOnEntry": true,
        "pythonPath": "${config:python.pythonPath}",
        "program": "${file}",
        "cwd": "",
        "env":{},
        "envFile": "${workspaceRoot}/.env",
        "debugOptions": [
            "WaitOnAbnormalExit",
            "WaitOnNormalExit",
            "RedirectOuput"
        ]
    },
    {
        "name": "Python: Attach",
        "type": "python",
        "request": "attach",
        "port": 5678,
        "host": "localhost"
    },
    {
        "name": "Python: Module",
        "type": "python",
        "request": "launch",
        "module": "enter-your-module-name-here",
        "console": "integratedTerminal"
    },
    {
        "name": "Python: Django",
        "type": "python",
        "request": "launch",
        "program": "${workspaceFolder}/manage.py",
        "console": "integratedTerminal",
        "args": [
            "runserver",
            "--noreload",
            "--nothreading"
        ],
        "django": true
    },
    {
        "name": "Python: Flask",
        "type": "python",
        "request": "launch",
        "module": "flask",
        "env": {
            "FLASK_APP": "app.py"
        },
        "args": [
            "run",
            "--no-debugger",
            "--no-reload"
        ],
        "jinja": true
    },
    {
        "name": "Python: Current File (External Terminal)",
        "type": "python",
        "request": "launch",
        "program": "",
        "console": "externalTerminal"
    }
]

}

最佳答案

       "name": "Python",
       "type": "python",
       "request": "launch",
       "stopOnEntry": true,
       "pythonPath": "${config:python.pythonPath}",
       "program": "${file}",
       "cwd": "",
       "env":{},
       "envFile": "${workspaceRoot}/.env",
       "console": "none" //add this and go

关于python-3.x - VS 代码 : "Property Debug Options Not Allowed",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52807693/

相关文章:

Firebase服务附加调试器与VS Code

visual-studio-code - 内核无法在 Visual Studio Code 中开始使用带有 Jupyter 的 conda 环境

python - 无法在 VSCode 中打开 jupyter notebook

visual-studio-code - Visual Studio Code 智能感知随时显示一个建议

python-3.x - dpkg 查询 : package 'python-meep' is not installed

python - 如何使用 std[in/out/err] 以外的文件描述符?

python - 两只随机行走的 turtle 的无限循环

visual-studio-code - 如何更改 VS Code 的文件排序?

python - 使用 Pytorch 实现 FFT

visual-studio-code - 为什么 vscode vim.otherModesKeyBindingNonRecursive 是未知配置?