Closed
Description
It's currently not possible to use multiroot-workspace variable scoping to configure python.defaultInterpreterPath
, as @kimadeline mentioned in #18207 (comment).
My use case is the following. I have multiple python projects in my workspace but I want them all to use the same virtualenv, existing under one of the workspace folders. The tree structure looks like this:
/
├── python-a/
│ ├── .venv/
│ └── foo.py
├── python-b/
│ └── bar.py
To make it work with python.defaultInterpreterPath
I need to configure it like this in the workspace file:
"python.defaultInterpreterPath": "${workspaceFolder}/../python-a/.venv/bin/python"
This is fragile, as it will break if python-b/
workspace folder changes its absolute path. With multiroot-workspace variable scoping it would be possible to express this dependency more robustly like this:
"python.defaultInterpreterPath": "${workspaceFolder:python-a}/.venv/bin/python"