When setting "python.pythonPath" to "python", resolve python interpreter in the same way as we resolve 'python' in terminal
See original GitHub issueQuestion
Why does setting "python.pythonPath"
to "python"
trigger automatic path detection instead of regular path resolution as in which python
/where python
?
The regular path resolution would be much more useful and less counter-intuitive when working with virtual environments or manually compiled python distributions that happens to be placed before the system python installation in the PATH
environment variable.
IMO explicitly specifying a setting shouldn’t be treated as not specifying it at all. At the very least it should be clear to the user that the path resolution is only done if the setting is not empty and not equal to "python"
(which is still bad but much more transparent to the user).
The line containing the relevant logic can be found here.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
Currently, setting
"python.pythonPath"
to"python"
is equivalent to not setting"python.pythonPath"
at all. We currently auto-select interpreters in both cases.The requirement is that when
"python.pythonPath"
is set to"python"
, instead of auto-selecting the interpreter, select the same interpreter that is referred to when typing"python xyz.py"
in terminal. Hope that’s clearer now.Thanks for the suggestion 👍 but we decided not to move forward with this idea for now.