Skip to content

Add the ability to disable the new DeprecatePythonPath feature #17693

Closed

Description

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.

Activity

  1. removed their assignment
    on Oct 11, 2021
  2. luabud commented on Oct 12, 2021

    @luabud
    Member

    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?

  3. jan11011977 commented on Nov 29, 2021

    @jan11011977
    Author

    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.

  4. luabud commented on Dec 29, 2021

    @luabud
    Member

    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.

  5. 11 remaining items

  6. karrtikr commented on Jan 7, 2022

    @karrtikr

    Ok actually I have one more suggestion related to the "No Python interpreter is selected" dialog (see image below)

    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?

  7. karrtikr commented on Jan 7, 2022

    @karrtikr

    If there was a single command to clear them all, I could then tell everyone "if you are having issues, please run this command and it will fix it".

    Working on adding a "Clear all" option in the 'Clear Interpreter Command':

    image

  8. jan11011977 commented on Jan 7, 2022

    @jan11011977
    Author

    Fantastic! Thank you so much

  9. karrtikr commented on Jan 7, 2022

    @karrtikr

    Created #17667 to track #17693 (comment).

  10. NorthIsUp commented on Jan 10, 2022

    @NorthIsUp

    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

  11. kariharju commented on Jan 18, 2022

    @kariharju

    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.

  12. karrtikr commented on Jan 18, 2022

    @karrtikr

    That is correct.

  13. locked as resolved and limited conversation to collaborators on Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-editor-*User-facing catch-allfeature-requestRequest for new features or functionalityverifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions