【发布时间】:2019-07-06 06:18:37
【问题描述】:
我已经在 Linux Manjaro 中安装了带有 Python 扩展的 Visual Studio Code。当我尝试启动 Python 脚本时,外部终端会打开,但 5 秒后我在一个窗口中收到一条错误消息,告诉我“超时”并且我的脚本没有启动。
我看到this 在 Windows 10 上发布了同样的问题,但修复似乎不适用于 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"
}
]
}
【问题讨论】:
-
能否请您显示您的
launch.json中的条目?也许您想尝试将"console"切换为"integratedTerminal"或"none"。你在 Manjaro 中使用的默认终端是什么? -
集成终端运行良好,但我更喜欢在外部终端中运行。我尝试使用 xterm 和 konsole。它们都产生相同的错误。
-
也许你应该看看this。似乎 vscode 与每个终端都不兼容。您使用的是哪种桌面环境?我正在使用 Gnome,并且使用外部终端进行调试工作正常。
-
我正在使用 KDE。非常感谢您的回答。我想我必须尝试其他终端。你有什么建议吗?
标签: python linux visual-studio-code kde manjaro