Ask questionsDifferent python.defaultInterpreterPath by workspace not being saved
According to https://github.com/microsoft/vscode-python/wiki/AB-Experiments workspace specific settings for the default Python interpreter should be possible via a new python.defaultInterpreterPath user setting.
python.defaultInterpreterPath is shared between multiple workspaces.
user@MacBook-pro project1 % pipenv shell Launching subshell in virtual environment… . /Users/user/.local/share/virtualenvs/project1-Vn51bfDI/bin/activate user@MacBook-Pro project1 % . /Users/user/.local/share/virtualenvs/project1-Vn51bfDI/bin/activate (project1) user@MacBook-Pro project1 % code .
user@MacBook-pro project2 % pipenv shell Launching subshell in virtual environment… . /Users/user/.local/share/virtualenvs/project2-y-K1Kf4d/bin/activate user@MacBook-Pro project2 % . /Users/user/.local/share/virtualenvs/project2-y-K1Kf4d/bin/activate (project2) user@MacBook-Pro project2 % code .
In project 1, set python.defaultInterpreterPath in project1 to /Users/user/.local/share/virtualenvs/stdapplib-Vn51bfDI/bin/python
In project 2, bring up Preferences to see that python.defaultInterpreterPath is already set to the virtualenv path for project1.
Maybe I'm misunderstanding how this is supposed to work, but a being able to reference a different virtualenv interpreter for each project seems to be a requirement based on the need to not lose prior functionality.
Answer questions karrtikr
Sorry, what I meant was
python.defaultInterpreterPath only works for user setting, whereas
python.pythonPath worked for all 3 - user, workspace, and workspace folder setting. So
python.defaultInterpreterPath is not a replacement for the
but where is that stored?
It's stored in an internal VSCode storage like I said above.
To sum it up,
python.pythonPathsetting is being removed from all 3 scopes - User, workspace, workspace folder.
python.defaultInterpreterPathis introduced which is meant as a replacement for
python.pythonPathin user scope, but not in workspace scope.
settings.json, but an internal storage.
Hope this make things clearer.