Skip to content

On macOS, selecting venv interpreter actually selects system interpreter #13603

@matangover

Description

@matangover

Environment data

  • VS Code version: 1.48.0
  • Extension version: v2020.8.103604
  • OS and version: macOS 10.14.6
  • Python version: 3.8.1
  • Type of virtual environment used: venv
  • Value of the python.languageServer setting: Pylance

Steps to reproduce

  1. Python: Select Interpreter -> Enter interpreter path... -> Find...
  2. Browse to a venv bin directory, e.g. Documents/my-venv/bin
  3. Select the python file (it's actually a symlink, because it's a venv)
  4. Click Select Interpreter

Expected behaviour

The selected venv should show up in the interpreter status bar.

Actual behaviour

The system interpreter is selected instead. That is because the file chooser dialog follows the venv's python symlink and returns the path to the system python (or more accurately, to the Python used to create the venv).

Discussion

Electron has a noResolveAliases option for showOpenDialog, but seems like this isn't available in VS Code. One workaround is typing the path manually instead of browsing. This may be clarified to the user somehow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugmacosneeds spikeLabel for issues that need investigation before they can be worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions