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'
相关推荐
m0_613856294 小时前
mysql如何利用事务隔离级别解决特定业务冲突_mysql隔离方案选型
jvm·数据库·python
xskukuku4 小时前
VSCode中的Codex插件如何调用第三方API
vscode·ai·codex
我的xiaodoujiao4 小时前
API 接口自动化测试详细图文教程学习系列16--项目实战演练3
python·学习·测试工具·pytest
ID_180079054734 小时前
Python 实现亚马逊商品详情 API 数据准确性校验(极简可用 + JSON 参考)
java·python·json
时空系5 小时前
第10篇:继承扩展——面向对象编程进阶 python中文编程
开发语言·python·ai编程
代码AI弗森6 小时前
配置文件战争:TOML/YAML/JSON 为何成为不同框架的“专属标配”?
json
CHANG_THE_WORLD6 小时前
python 批量终止进程exe
开发语言·python
liann1196 小时前
3.2_红队攻击框架--MITRE ATT&CK‌
python·网络协议·安全·网络安全·系统安全·信息与通信
云天AI实战派6 小时前
AI 智能体问题排查指南:ChatGPT、API 调用到 Agent 上线失灵的全流程修复手册
大数据·人工智能·python·chatgpt·aigc
我的xiaodoujiao7 小时前
API 接口自动化测试详细图文教程学习系列15--项目实战演练2
python·学习·测试工具·pytest