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

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

情况描述

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

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

...
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启动文件上添加:

__import__('os').environ['GEVENT_SUPPORT'] = 'true'

在这里插入图片描述

相关推荐

  1. goland debug断点失效

    2024-04-25 12:14:03       33 阅读
  2. 线程进程的使用场景和常见问题处理

    2024-04-25 12:14:03       39 阅读
  3. php进程处理任务

    2024-04-25 12:14:03       33 阅读
  4. python进程multiprocessing卡住问题

    2024-04-25 12:14:03       12 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-25 12:14:03       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-25 12:14:03       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-25 12:14:03       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-25 12:14:03       18 阅读

热门阅读

  1. SQL Server详细使用教程

    2024-04-25 12:14:03       16 阅读
  2. go学习知识点

    2024-04-25 12:14:03       17 阅读
  3. Linux网络设置

    2024-04-25 12:14:03       12 阅读
  4. @PropertySource的使用

    2024-04-25 12:14:03       11 阅读
  5. mysql表锁了

    2024-04-25 12:14:03       12 阅读
  6. 【Redis(7)】缓存技术的挑战及设计方案

    2024-04-25 12:14:03       12 阅读