-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail to use an environment variable in python.defaultInterpreterPath
on Windows
#10692
Comments
Hi @wdscxsj 👋 I am assuming you're using environment variables here as you don't want to commit your |
I see. In that case, consider the workaround: If no interpreter is specified in settings, we check the |
Sure, that's good enough. Actually it's been a surprise to me that the first Python on |
I just realized that the original bug you described will still be applicable for #10375 . I am reopening the issue and changing the title accordingly. |
python.defaultInterpreterPath
on Windows
Thanks a lot for your active work! In sum, please help with a configuration of default (no-confirmation) Python that works across multiple hosts and under both folder mode and single file mode. My original idea of per-host |
Can you simply use User settings or Remote settings in this case? |
You need to put the |
Environment data
Expected behaviour
An environment variable in
python.pythonPath
is respected across all platforms.Actual behaviour
Works on Linux (via Remote SSH), but fails on Windows.
Steps to reproduce:
"python.pythonPath": "{env:PYTHON_FOR_VSCODE}"
insettings.json
.PYTHON_FOR_VSCODE
to point to an installed Python interpreter, in my caseC:\Tools\Python3\python.exe
.current: {env:PYTHON_FOR_VSCODE}
, and lists my locally installed Python interpreters, includingC:\Tools\Python3\python.exe
. Choosing it works fine, but defeats the purpose of using an environment variable.%PYTHON_FOR_VSCODE% --version
runs as expected.The text was updated successfully, but these errors were encountered: