Skip to content

pyenv environments not detected when using Snap-install on Ubuntu, with nonstandard PYENV_ROOT #4179

@d3r3kk

Description

@d3r3kk

Pyenv is not detected when the VS Code editor is installed via the Snap installer in Ubuntu 18.x, and PYENV_ROOT is not set to the standard ~/.pyenv path.

Note: If the PYENV_ROOT is set to a directory such as /opt/python/pyenv then setting the "python.venvFolders": [ "../../opt/python/pyenv" ] results in an ENOENT error when loading the extension.

Environment data

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

Expected behaviour

VS Code Python extension can detect all available versions in the pyenv install. All versions available to the user when they issue the pyenv versions command.

Actual behaviour

No python versions installed via pyenv are shown.

Steps to reproduce:

  1. Set a non-standard root to PYENV_ROOT before running the installer script (such as /opt/python/pyenv).
    • export PYENV_ROOT=/opt/python/pyenv
  2. Install pyenv according to the instructions in the pyenv-installer README.
  3. Install at least one version of Python using pyenv install.
    • pyenv install 3.7-dev
  4. Ensure pyenv can see the installed version:
    • pyenv versions
  5. Install VS Code using the Installer software that ships with Ubuntu. This is the snap installation.
  6. Open VS Code and install the Python extension.
  7. Open a workspace that contains a Python file, and wait until the extension loads.
  8. Click on the interpreter in the status bar and observe the Python interpreters that are available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable buglinuxverifiedVerification succeeded

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions