Skip to content

Support pyenv if it is installed in a non-default directory #2142

Closed
@wedeluxe

Description

@wedeluxe

Environment data

  • VS Code version: 1.25.0
  • Extension version (available under the Extensions sidebar): 2018.6.0
  • OS and version: Arch Linux (up-to-date)
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.6 (pyenv)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A

Actual behavior

Assuming pyenv is installed in a non-default dir.
Python interpreters installed with pyenv are not listed when running the "Python: Select Interpreter" command.

Expected behavior

Assuming pyenv is installed in a non-default dir.
Python interpreters installed with pyenv are listed when running the "Python: Select Interpreter" command.

Steps to reproduce:

  1. Properly install pyenv to a non-default location, i.e. a directory different from ~/.pyenv.
    This includes setting the PYENV_ROOT environment variable to the chosen directory.
  2. Install one or more Python versions using pyenv. Example: pyenv install 3.6.6.
  3. Within vscode run the "Python: Select Interpreter" command.
  4. All Python versions/interpreters installed in step (2) are not included in the list shown.

Workaround

Create a symlink in the home directory pointing to the actual pyenv dir.
ln -s /the/actual/path/to/pyenv ~/.pyenv

After doing so, all Python versions installed with pyenv are listed in the select interpreter area.

Proposed Solution

  • Do not hardcode the pyenv root dir to ~/.pyenv.
  • Read its location from the PYENV_ROOT environment variable.
  • (Maybe) use ~/.pyenv as fallback value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionalityinfo-neededIssue requires more information from poster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions