Vscode | Python | launch.json配置gevent多进程断点失效问题处理

Vscode | Python | launch.json配置gevent多进程断点失效问题处理

文章目录

情况描述

launch.json

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": "运行",
            "type": "debugpy",
            "request": "launch",
            "program": "${workspaceFolder}/odoo/odoo-bin",
            "console": "integratedTerminal",
            "justMyCode": true,
            "args": [
                "--config",
                "${workspaceFolder}/config/odoo.conf"
            ],
            
        }
    ]
}

在我使用vscode运行Python工程时,console界面中疯狂提示:

text 复制代码
...
It seems that the gevent monkey-patching is being used.
Please set an environment variable with:
GEVENT_SUPPORT=True
to enable gevent support in the debugger.
It seems that the gevent monkey-patching is being used.
Please set an environment variable with:
GEVENT_SUPPORT=True
to enable gevent support in the debugger.
It seems that the gevent monkey-patching is being used.
Please set an environment variable with:
GEVENT_SUPPORT=True
to enable gevent support in the debugger.
It seems that the gevent monkey-patching is being used.
Please set an environment variable with:
GEVENT_SUPPORT=True
to enable gevent support in the debugger.
...

通过网上搜索,说可以在launch.json配置文件中添加"gevent":true,于是添加后不提示了,但是Subprocess的断点却不走了,测来测去就是这个gevent的问题:

  1. 不添加gevent,疯狂提示让我配置环境变量;
  2. 添加了gevent,子进程的断点又不跑;

↓↓↓解决办法直接看这里↓↓↓

launch.json不要添加gevent的配置,在python启动文件上添加:

python 复制代码
__import__('os').environ['GEVENT_SUPPORT'] = 'true'
相关推荐
2301_8050545627 分钟前
Python训练营打卡Day59(2025.7.3)
开发语言·python
万千思绪1 小时前
【PyCharm 2025.1.2配置debug】
ide·python·pycharm
微风粼粼2 小时前
程序员在线接单
java·jvm·后端·python·eclipse·tomcat·dubbo
云天徽上3 小时前
【PaddleOCR】OCR表格识别数据集介绍,包含PubTabNet、好未来表格识别、WTW中文场景表格等数据,持续更新中......
python·ocr·文字识别·表格识别·paddleocr·pp-ocrv5
我在看世界3 小时前
家里vscode连公司内网vscede
vscode·ssh
你怎么知道我是队长3 小时前
python-input内置函数
开发语言·python
叹一曲当时只道是寻常3 小时前
Python实现优雅的目录结构打印工具
python
百锦再4 小时前
.Net配置文件appsetting.json的几种读取方法
chrome·json·.net·依赖注入·appsetting·web.config
hbwhmama4 小时前
python高级变量XIII
python
费弗里4 小时前
Python全栈应用开发利器Dash 3.x新版本介绍(3)
python·dash