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

Python Language Server "unable to determine path to interpreter" should be actionable #2983

Closed
qubitron opened this issue Oct 23, 2018 · 4 comments
Assignees
Labels
feature-request Request for new features or functionality important Issue identified as high-priority

Comments

@qubitron
Copy link

qubitron commented Oct 23, 2018

Environment data

  • VS Code version: 1.28.2 (user setup)
  • Extension version (available under the Extensions sidebar): 2018.9.1
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Have python 2.7, 3.6, 3.7 and anaconda installed
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): None (yet)
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

Opened a folder with a single empty hello.py file:
image

No python interpreter is selected, and I get this error message immediately after opening the file

Expected behavior

The dialog should instead say something like

No Python interpreter is selected, you need to select a Python interpreter to enable features such as IntelliSense, linting, and debugging.
[ Select Python Interpreter ] 
d3r3kk added a commit to d3r3kk/vscode-python that referenced this issue Oct 26, 2018
Fix for microsoft#2983

- Add button to warning message that opens interpreter selector
- Add localization
@d3r3kk
Copy link

d3r3kk commented Oct 26, 2018

Current behaviour is indeed unactionable:

2983_unresolvable_msg_no_interpreter_yet

I propose we do something like so:

2983_proposal_make_actionable

Branch for person who would implement such a thing.

Note: The popup for dependencies such as linters should probably be deferred until after this action is taken as well. Covered in #2811.

@d3r3kk d3r3kk added feature-request Request for new features or functionality needs decision labels Oct 26, 2018
@d3r3kk d3r3kk removed their assignment Oct 26, 2018
@d3r3kk d3r3kk removed the triage label Oct 26, 2018
@DonJayamanne
Copy link

DonJayamanne commented Oct 26, 2018

@d3r3kk
I'd change this as follows:

  • Modify pythonInterpreter.ts (but only check currently selected interpreter) to add a new diagnostic InvalidPythonInterpreterDiagnostic (that would check if the selected interpreter is valid or not)
  • Should be a very simple change.

Benefits:

  • Consistent approach to validations/checks
  • Consistent UX (displaying message and prompt, e.g. button would read Select Python Interpreter)
  • Catch the error early on
  • Benefits the entire extension (currently this validation is done in language server code, but linters, formatters, etc all fail due to the invalid python interpreter having been selected).

@DonJayamanne
Copy link

Changing label to Needs PR, as that's whats been requested (a change, and the UI has been provided).

@DonJayamanne
Copy link

DonJayamanne commented Oct 26, 2018

@brettcannon
This is a very simple change that improves the getting started experience, hence changing the label to P1.
As discussed, if you disagree please feel free to change the priority.

@DonJayamanne DonJayamanne added the important Issue identified as high-priority label Oct 26, 2018
@d3r3kk d3r3kk self-assigned this Nov 3, 2018
d3r3kk added a commit to d3r3kk/vscode-python that referenced this issue Nov 3, 2018
…ly selected, make the message actionalble.

For microsoft#2983

- [x] Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
- [x] Title summarizes what is changing
- [x] Has a [news entry](https://github.com/Microsoft/vscode-python/tree/master/news) file (remember to thank yourself!)
- [x] Unit tests & system/integration tests are added/updated
- [x] ~[Test plan](https://github.com/Microsoft/vscode-python/blob/master/.github/test_plan.md) is updated as appropriate~ *(This is covered by assertions already present)*
- [x] ~[`package-lock.json`](https://github.com/Microsoft/vscode-python/blob/master/package-lock.json) has been regenerated by running `npm install` (if dependencies have changed)~
DonJayamanne pushed a commit that referenced this issue Nov 7, 2018
@DonJayamanne DonJayamanne self-assigned this Nov 14, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Dec 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality important Issue identified as high-priority
Projects
None yet
Development

No branches or pull requests

4 participants