Skip to content

Select pyenv environment based on folder .python-version file #1167

Closed
@dan-blanchard

Description

@dan-blanchard

Environment data

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

Actual behavior

You have to manually select the pyenv interpreter for each workspace folder.

Expected behavior

It should detect the workspace pyenv interpreter based on the .python-version file present in the workspace folder root.

For example, every folder I have added to my workspace has a .python-version file that pyenv creates when you run pyenv local NAME_OF_VENV in that folder. The file contains a single string which is the name of the folder/symlink in ~/.pyenv/versions/ that should be used.

Metadata

Metadata

Assignees

Labels

area-environmentsFeatures relating to handling interpreter environmentsfeature-requestRequest for new features or functionalitylinuxmacosneeds PRReady to be worked onon-testplanAdded to test plan

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions