How to set python environment variables in VS Code?
I know how to add arguments for the Python script I want to run. For example, if test.py is my script file and it has one argument like '--batch_size' then I can edit launch.json in VS Code and set "args": ["--batch_size", "32"]

But I don't know how to add environmental arguments for Python itself. For example, Python has -m environmental variable, which runs library module as a script. If I want to run python -m torch.distributed.launch test.py --batch_size 32, what should I edit in VS Code to run the debugger?

UPDATE:
Here is my launch.json



-m is not environmental variable. It's just a regular argument.

To run python -m torch.distributed.launch test.py --batch_size 32 use args  "args": ["-m", "torch.distributes.launch" ,"--batch_size", "32"] Also you need to run python itself instead of running script to pass these args to it ("program": "python3").

To set actual environment variables use "env": {"ENV_VAR_NAME1": "value of ENV_VAR_NAME1", "ENVVAR2": "Value for ENVVAR2"}

Here you can find more information about launch.json configuration
