这对我有用:
在launch.json配置文件条目中,指定一个名为“ env”的新条目,然后自行设置PYTHONPATH。
"configurations": [ { "name": "Python", "type": "python", "stopOnEntry": false, "request": "launch", "pythonPath": "${config.python.pythonPath}", "program": "${file}", "cwd": "${workspaceRoot}", "debugOptions": [ "WaitOnAbnormalExit", "WaitOnNormalExit", "RedirectOutput" ], "env": { "PYTHONPATH": "/path/a:path/b" } }]


