gpt4 book ai didi

python - 在 Manjaro 中使用外部终端时出现超时错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:14:41 25 4
gpt4 key购买 nike

我已经在 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"
}
]

最佳答案

不幸的是,VSCode 并不兼容所有终端,而且它似乎(还)不兼容您在 KDE 桌面环境 中安装的 Linux Manjaro

切换到另一个终端肯定会解决这个问题(即 GNOME 终端)。我不确定 gnome-terminal 包是否可以在不安装 GNOME 桌面环境 的情况下使用。

Here是一个很好的解决方案,您如何在不重新安装整个操作系统的情况下执行此操作。

关于python - 在 Manjaro 中使用外部终端时出现超时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54652845/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com