Skip to content
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

Improve "No Python interpreter" selected prompt #17667

Closed
roblourens opened this issue Oct 8, 2021 · 11 comments · Fixed by #19397
Closed

Improve "No Python interpreter" selected prompt #17667

roblourens opened this issue Oct 8, 2021 · 11 comments · Fixed by #19397
Assignees
Labels
area-editor-* User-facing catch-all feature-request Request for new features or functionality on-testplan Added to test plan
Milestone

Comments

@roblourens
Copy link
Member

Environment data

  • VS Code version: 1.62-insider
  • Extension version (available under the Extensions sidebar): v2021.10.1317843341

I think this just showed up today, but I can't give exact repro steps. I was doing python things in different repos for awhile. At some point, I noticed that I get this notification every time I open a window with a python project

image

I don't usually see that. Then I noticed that I have this setting, which I definitely didn't set manually: "python.defaultInterpreterPath": "/opt/python/latest/bin/python". Removing that makes the notification go away. Is there something in the extension that adds that setting? That path does not exist for me.

@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team labels Oct 8, 2021
@karthiknadig karthiknadig added area-editor-* User-facing catch-all triage and removed triage-needed Needs assignment to the proper sub-team labels Oct 11, 2021
@karrtikr karrtikr added investigating We are looking into the cause of the issue and removed triage labels Oct 11, 2021
@karrtikr
Copy link

Then I noticed that I have this setting, which I definitely didn't set manually:

We set it in User settings when an interpreter is chosen manually, but we never modify this setting for the workspace as far as I'm aware of.

Instead of "No Python Interpreter is selected" prompt, we should show a "Invalid Python Interpreter selected" prompt, we'll fix that with this issue.

@karrtikr karrtikr added feature-request Request for new features or functionality needs PR and removed bug Issue identified by VS Code Team member as probable bug investigating We are looking into the cause of the issue labels Oct 11, 2021
@karrtikr karrtikr removed their assignment Oct 11, 2021
@karrtikr karrtikr changed the title defaultInterpreterPath and interpreter notification Modify "No Python interpreter" selected prompt to "Invalid python interpreter" when invalid interpreter is selected Oct 11, 2021
@roblourens
Copy link
Member Author

roblourens commented Oct 11, 2021

But does that mean that I would have picked an interpreter at that path? Because there is no interpreter there, so I don't know how that path was selected. And yes this was User settings, not Workspace.

@karrtikr
Copy link

I would have picked an interpreter at that path?

I would think so, maybe the path got removed with the latest python update.

One other case I can think of where we write to the setting:
This setting was earlier called python.pythonPath and we did a "one time" migration to python.defaultInterpreterPath. We used internal VSCode database storage to ensure it was only done one time.

@roblourens
Copy link
Member Author

I wonder whether it would have come from codespaces or a devcontainer? I was trying those at some point. I think it should be a machine-scoped setting to avoid being synced.

@karrtikr
Copy link

karrtikr commented Oct 12, 2021

Oh yes, that could happen, will double check.

@karrtikr
Copy link

karrtikr commented Oct 12, 2021

The scope is set to resource as it can be configured in all scopes: user, remote, workspace or folder settings. We use the configuration target as global when updating using

update(section: string, value: any, configurationTarget?: ConfigurationTarget | boolean | null, overrideInLanguage?: boolean): Thenable<void>

API. Should it still write to User settings even in remote scenarios?

@roblourens
Copy link
Member Author

I think machine-overridable might be the right scope here

@karrtikr
Copy link

FYI I have fixed the scope of setting with #17732

@karrtikr karrtikr removed the investigating We are looking into the cause of the issue label Oct 13, 2021
@karrtikr karrtikr removed their assignment Oct 13, 2021
@karrtikr karrtikr changed the title Modify "No Python interpreter" selected prompt to "Invalid python interpreter" when invalid interpreter is selected Improve "No Python interpreter" selected prompt Jan 7, 2022
@karrtikr
Copy link

karrtikr commented Jan 7, 2022

@karrtikr
Copy link

karrtikr commented Jul 2, 2022

Also, remove Python is not installed prompt in favor of No Interpreter Selected prompt. This will ensure when users finish installing Python from windows store, it shows up without reload when following the prompt to open the interpreter list. (For #19099)

@karrtikr
Copy link

karrtikr commented Jul 13, 2022

  • If an invalid interpreter is selected:
    image
  • If no Python is installed:
    image
    selecting which leads to:
    image

@karrtikr karrtikr added the verification-needed Verification of issue is requested label Jul 13, 2022
@karrtikr karrtikr added on-testplan Added to test plan and removed verification-needed Verification of issue is requested labels Jul 25, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-editor-* User-facing catch-all feature-request Request for new features or functionality on-testplan Added to test plan
Projects
None yet
4 participants