Skip to content

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

Closed

Description

@qubitron

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 ] 

Activity

  1. d3r3kk commented on Oct 26, 2018

    @d3r3kk

    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.

  2. removed their assignment
    on Oct 26, 2018
  3. DonJayamanne commented on Oct 26, 2018

    @DonJayamanne

    Derek Keeler (@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).
  4. DonJayamanne commented on Oct 26, 2018

    @DonJayamanne

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

  5. DonJayamanne commented on Oct 26, 2018

    @DonJayamanne

    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.

  6. added
    important
    on Oct 26, 2018
  7. locked as resolved and limited conversation to collaborators on Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestimportant

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions