Skip to content

VS Code gives error there is no interpreter selected #3326

Closed

Description

@qubitron

Environment data

  • VS Code version: XXX
  • Extension version (available under the Extensions sidebar): XXX
  • OS and version: XXX
  • Python version (& distribution if applicable, e.g. Anaconda): XXX
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): XXX
  • Relevant/affected Python packages and their versions: XXX

Actual behavior

image

After clicking X:
image

Similar issue on macOS but instead it says "the default interpreter is invalid.

Expected behavior

VS Code selects a default python interpreter, or only does the second step

Steps to reproduce:

  1. mkdir newapp
  2. code .
  3. add hello.py
  4. open it

Logs

Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

XXX

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

XXX

Activity

  1. added
    bug
    on Nov 13, 2018
  2. DonJayamanne commented on Nov 14, 2018

    @DonJayamanne

    Dan Taylor (@qubitron)
    Are you testing this against the latest development version of the extension?
    If not, please could you do so.

  3. qubitron commented on Nov 14, 2018

    @qubitron
    Author

    Yes, I still have the issue against the latest development version of the extension (2018.11.0-alpha), on a mac:

    mkdir newapp
    cd newapp
    code .
    

    Create new file "hello.py"
    image

    Click the close button and then the interpreter shows:
    image

  4. DonJayamanne commented on Nov 14, 2018

    @DonJayamanne

    VS Code selects a default python interpreter, or only does the second step

    Ok, I think I know what we need to do.
    When VS Code loads and displays this message we need two options:

    • [Change Default Python Interperter]
      • This will change the default python interpreter for the user in VS Code.
      • We basically update python.pythonPath in the user settings.json file
    • [Select Python Interpeter]
      • Same as today, we update python.pythonPath in the workspace settings.json file

    Next time VSC loads, user will not be prompted.

    Dan Taylor (@qubitron)
    Please could you try the following:

    • Open VSC, go into your user settings.json
    • Update python.pythonPath to point to a valid python executable
    • Reload VS Code (test this issue all over again), confirm this resolves the issue.

    screen shot 2018-11-14 at 2 42 36 pm

  5. added
    feature-request
    and removed
    bug
    on Nov 15, 2018
  6. DonJayamanne commented on Nov 15, 2018

    @DonJayamanne

    Changes:

    • Remove dup ls message
    • Auto select python environment before python validations
    • Change label from 'available' to 'installed'
  7. locked as resolved and limited conversation to collaborators on Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions