Is it possible to automate or relocate a launch.json
setting to the user settings so I do not have to edit the same line in each launch.json
?
I have many Python modules in a directory outside of the Python Path and currently am having to edit each launch.json
file to add the following line:
"env": {"PYTHONPATH": "\\my\\custom\\path"}
I tried adding the following line to User Settings, but it did not work:
"python.envFile": "\\path\\to\\python\\env\\file"
where the *.env
contains the following:
"PYTHONPATH": "\\my\\custom\\path"
VScode I can open any python file that import from a custom path, right click and run it through VScode - I assume VScode is calling the native Python interpreter and seeing the PYTHONPATH environment variable.
Some Python environments (Spyder, PyCharm, etc) have a global setting for this, but I do not know how to accomplish this in VScode. Note VScode is consistent with PTVS; I have to edit the Search Paths for each Python solution in Visual Studio.