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的问题:
launch.json不要添加gevent的配置,在python启动文件上添加:
__import__('os').environ['GEVENT_SUPPORT'] = 'true'