Skip to content

VS Code does not use pyenv global Python version by default #8646

@jab

Description

@jab

Bug description

The https://www.gitpod.io/docs/languages/python#python-versions docs explain how to use pyenv to install and use a different global version of Python from the system version, namely pyenv install x.y.z && pyenv global x.y.z. (This is particularly important because the system version of Python is 3.8, which is old enough to be in security-fix-only status, i.e. no longer receiving bugfixes.)

Even if you follow these docs, though, VS Code still starts up using Python 3.8 by default:

Either the docs should be expanded to explain how to configure VS Code to use the global version of Python that the .gitpod.yml maintainer has chosen via pyenv global x.y.z, or better yet, GitPod should automatically configure VS Code to use the version that the .gitpod.yml maintainer has chosen via pyenv global x.y.z, so that it is not necessary for each .gitpod.yml maintainer who is following these docs to repeat all this extra boilerplate.

An example can be found in:

Steps to reproduce

  1. Follow the https://www.gitpod.io/docs/languages/python#python-versions docs to use pyenv to install a different Python version and choose it as the global version in the init task, as in https://github.com/jab/bidict/blob/062ccb6a72f181295be54adb1ebdafaaad5cd2a3/.gitpod.yml#L19-L28
  2. Open the resulting workspace
  3. Observe that VS Code still starts up using the system Python version (3.8) rather than the configured pyenv global version.

Workspace affected

No response

Expected behavior

No response

Example repository

https://github.com/jab/bidict

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions