1

我已经在 Linux Manjaro 中安装了带有 Python 扩展的 Visual Studio Code。当我尝试启动 Python 脚本时,外部终端会打开,但 5 秒后我在窗口中收到一条错误消息,告诉我“超时”并且我的脚本没有启动。

我看过这个文章,但修复似乎不适用于 Manjaro。任何想法?

这是我的 launch.json 文件

{
// 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 (Integrated Terminal)",
        "type": "python",
        "request": "launch",
        "program": "${file}",
        "console": "integratedTerminal"
    },
    {
        "name": "Python: Remote Attach",
        "type": "python",
        "request": "attach",
        "port": 5678,
        "host": "localhost",
        "pathMappings": [
            {
                "localRoot": "${workspaceFolder}",
                "remoteRoot": "."
            }
        ]
    },
    {
        "name": "Python: Module",
        "type": "python",
        "request": "launch",
        "module": "enter-your-module-name-here",
        "console": "integratedTerminal"
    },
    {
        "name": "Python: Django",
        "type": "python",
        "request": "launch",
        "program": "${workspaceFolder}/IA_TD2.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": "${file}",
        "console": "externalTerminal"
    },
    {
        "name": "Python: Current File (None)",
        "type": "python",
        "request": "launch",
        "program": "${file}",
        "console": "none"
    }
]

}

4

1 回答 1

0

不幸的是,VSCode 并不与每个终端兼容,而且它似乎(还)不兼容你的Linux Manjaro安装和KDE 桌面环境

切换到另一个终端肯定会解决这个问题(即 GNOME 终端)。我不确定,如果gnome-terminal不安装GNOME Desktop Environment包是否可用。

是一个很好的解决方案,您可以如何在不重新安装整个操作系统的情况下做到这一点。

于 2019-02-12T16:43:49.347 回答