You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add the ability to disable the new DeprecatePythonPath feature #17693
Could we please add an option to go back to the old "pythonPath" behaviour.
Selecting the python interpreter using the "python.pythonPath" setting has been working great for us. We check our Python environments into source control, along with the vscode settings and our code. Our engineers don't have to worry about anything; they just open the vscode workspace and everything works.
With this new "defaultPythonPath" system, a lot of our engineers are ending up with the wrong interpreter (it doesn't help that when this feature was rolled out, VSCode would prompt people to change the interpreter and then highlight a "recommended" interpreter which was the wrong one).
Once they have selected the wrong interpreter, they are then stuck with a broken VSCode. For most of our engineers, Python isn't their primary language, so they have no idea what's wrong. They will just suffer with broken Intellisense and spurious linting errors, and assume it's meant to be like that.
If I'm being honest, this new feature is a nightmare for us. We are desperate to go back to the old system where everything is centrally controlled and just works.
Hi Jan van Valburg (@jan11011977), thanks for providing feedback. The new setting should have the same behavior as python.pythonPath did in terms of selecting the right interpreter when the workspace loads.
For context, the Python extension will only prompt to select an interpreter if it doesn't recognize the one defined by python.defaultInterpreterPath (and the same happens for python.pythonPath). So when you say the following, it sounds to me that what you're experiencing is actually a bug:
With this new "defaultPythonPath" system, a lot of our engineers are ending up with the wrong interpreter (it doesn't help that when this feature was rolled out, VSCode would prompt people to change the interpreter and then highlight a "recommended" interpreter which was the wrong one).
Are you able to share some steps so we can reproduce the issue?
My understanding is that python.defaultInterpreterPath is ignored if the user has already selected a valid Python interpreter. The trouble comes if the user has selected the wrong Python interpreter. We check a full Python install into source control, and we'd like VSCode to use that. however if a user selected a different (valid) interpreter for example one off their own machine, there is no way for us to correct that problem automatically.
Please correct me if I have misunderstood how this works.
Your understanding is correct. Our recommendation in this case is to not have the Python path checked into source control (i.e. remove the python.defaultInterpreterPath entry from .vscode/settings.json) for this not to happen, as rarely ever the path to the interpreter will be the same across different machines.
However I will keep this issue open so I can talk to the team about it and make a decision.
rarely ever the path to the interpreter will be the same across different machines.
many large orgs use tooling to ensure consistent environments. not being able to check in tooling configs for vs-code will make it significantly harder for our devs to onboard.
supporting the common case of ~/.virtualenvs would be very helpful
Pinging the API issue here as well (#16994)
..also trying to figure out if calling Python: Clear Workspace Interpreter Setting and then setting python.defaultInterpreterPath would be a way to get by this one.
Activity
luabud commentedon Oct 12, 2021
Hi Jan van Valburg (@jan11011977), thanks for providing feedback. The new setting should have the same behavior as
python.pythonPathdid in terms of selecting the right interpreter when the workspace loads.For context, the Python extension will only prompt to select an interpreter if it doesn't recognize the one defined by
python.defaultInterpreterPath(and the same happens forpython.pythonPath). So when you say the following, it sounds to me that what you're experiencing is actually a bug:Are you able to share some steps so we can reproduce the issue?
jan11011977 commentedon Nov 29, 2021
Hi Luciana Abud (@luabud), sorry for the late reply.
My understanding is that python.defaultInterpreterPath is ignored if the user has already selected a valid Python interpreter. The trouble comes if the user has selected the wrong Python interpreter. We check a full Python install into source control, and we'd like VSCode to use that. however if a user selected a different (valid) interpreter for example one off their own machine, there is no way for us to correct that problem automatically.
Please correct me if I have misunderstood how this works.
luabud commentedon Dec 29, 2021
Apologies for the delay in my response!
Your understanding is correct. Our recommendation in this case is to not have the Python path checked into source control (i.e. remove the python.defaultInterpreterPath entry from .vscode/settings.json) for this not to happen, as rarely ever the path to the interpreter will be the same across different machines.
However I will keep this issue open so I can talk to the team about it and make a decision.
11 remaining items
karrtikr commentedon Jan 7, 2022
This is also a great suggestion, but seeing as it's unrelated to the issue in hand, can you create a new issue for this?
karrtikr commentedon Jan 7, 2022
Working on adding a
"Clear all"option in the 'Clear Interpreter Command':jan11011977 commentedon Jan 7, 2022
Fantastic! Thank you so much
karrtikr commentedon Jan 7, 2022
Created #17667 to track #17693 (comment).
NorthIsUp commentedon Jan 10, 2022
many large orgs use tooling to ensure consistent environments. not being able to check in tooling configs for vs-code will make it significantly harder for our devs to onboard.
supporting the common case of
~/.virtualenvswould be very helpfulkariharju commentedon Jan 18, 2022
Pinging the API issue here as well (#16994)
..also trying to figure out if calling
Python: Clear Workspace Interpreter Settingand then settingpython.defaultInterpreterPathwould be a way to get by this one.karrtikr commentedon Jan 18, 2022
That is correct.