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
Python Language Server "unable to determine path to interpreter" should be actionable #2983
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:
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 ]
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).
Brett Cannon (@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.
Activity
Add 'Select' button to 'No Interpreter' warning message.
d3r3kk commentedon Oct 26, 2018
Current behaviour is indeed unactionable:
I propose we do something like so:
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.
DonJayamanne commentedon Oct 26, 2018
Derek Keeler (@d3r3kk)
I'd change this as follows:
InvalidPythonInterpreterDiagnostic(that would check if the selected interpreter is valid or not)Benefits:
Select Python Interpreter)DonJayamanne commentedon Oct 26, 2018
Changing label to
Needs PR, as that's whats been requested (a change, and the UI has been provided).DonJayamanne commentedon Oct 26, 2018
Brett Cannon (@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.
When opening a workspace with interpreters available but none current…
When opening a workspace with interpreters available but none current…