Skip to content

vscode reports incorrect python version #25008

@erentar

Description

@erentar

Type: Bug

Behaviour

python versions shown on vscode do not match versions reported by pet

Steps to reproduce:

  1. Open the python version selector from the bottom right corner
  2. Image
  3. these versions do not match what is reported by pet

output of pet:

$> /home/user/.vscode/extensions/ms-python.python-2025.4.0-linux-x64/python-env-tools/bin/pet
Manager (Conda)
   Executable  : /home/user/.local/share/miniforge3/bin/conda
   Version     : 24.11.3

Environment (Conda)
   Name        : base
   Executable  : /home/user/.local/share/miniforge3/bin/python
   Version     : 3.12.8
   Prefix      : /home/user/.local/share/miniforge3
   Manager     : Conda, /home/user/.local/share/miniforge3/bin/conda
   Symlinks    : "/home/user/.local/share/miniforge3/bin/python"
               : "/home/user/.local/share/miniforge3/bin/python3"
               : "/home/user/.local/share/miniforge3/bin/python3.12"

Environment (LinuxGlobal)
   Executable  : /usr/bin/python
   Version     : 3.13.3.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/usr/bin/python"
               : "/usr/bin/python3"
               : "/usr/bin/python3.13"

Environment (LinuxGlobal)
   Executable  : /bin/python
   Version     : 3.13.3.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/bin/python"
               : "/bin/python3"
               : "/bin/python3.13"

Environment (LinuxGlobal)
   Executable  : /bin/python2
   Version     : 2.7.18.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/bin/python2"
               : "/bin/python2.7"

Environment (LinuxGlobal)
   Executable  : /usr/bin/python2
   Version     : 2.7.18.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/usr/bin/python2"
               : "/usr/bin/python2.7"

Environment (LinuxGlobal)
   Executable  : /bin/python3.10
   Version     : 3.10.17.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/bin/python3.10"

Environment (LinuxGlobal)
   Executable  : /usr/bin/python3.10
   Version     : 3.10.17.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/usr/bin/python3.10"

Environment (LinuxGlobal)
   Executable  : /bin/python3.11
   Version     : 3.11.12.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/bin/python3.11"

Environment (LinuxGlobal)
   Executable  : /usr/bin/python3.11
   Version     : 3.11.12.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/usr/bin/python3.11"

Environment (LinuxGlobal)
   Executable  : /bin/python3.6
   Version     : 3.6.15.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/bin/python3.6"

Environment (LinuxGlobal)
   Executable  : /usr/bin/python3.6
   Version     : 3.6.15.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/usr/bin/python3.6"

Environment (LinuxGlobal)
   Executable  : /bin/python3.7
   Version     : 3.7.17.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/bin/python3.7"

Environment (LinuxGlobal)
   Executable  : /usr/bin/python3.7
   Version     : 3.7.17.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/usr/bin/python3.7"

Environment (LinuxGlobal)
   Executable  : /bin/python3.8
   Version     : 3.8.20.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/bin/python3.8"

Environment (LinuxGlobal)
   Executable  : /usr/bin/python3.8
   Version     : 3.8.20.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/usr/bin/python3.8"

Environment (LinuxGlobal)
   Executable  : /bin/python3.9
   Version     : 3.9.21.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/bin/python3.9"

Environment (LinuxGlobal)
   Executable  : /usr/bin/python3.9
   Version     : 3.9.21.final.0
   Prefix      : /usr
   Architecture: x64
   Symlinks    : "/usr/bin/python3.9"


Breakdown by each locator:
--------------------------
Conda                : 97.41292ms
Homebrew             : 1.289521ms
LinuxGlobal          : 653.462711ms
PipEnv               : 661ns
Pixi                 : 337ns
Poetry               : 92.044µs
PyEnv                : 140.715µs
Venv                 : 156ns
VirtualEnv           : 275ns
VirtualEnvWrapper    : 365ns

Breakdown for finding Environments:
-----------------------------------
GlobalVirtualEnvs    : 155.583µs
Locators             : 654.688144ms
Path                 : 992.438535ms
Workspaces           : 24.054272ms

Managers:
---------
Conda                : 1

Environments (17):
------------------
Conda                : 1
LinuxGlobal          : 16

Completed in 992ms

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.4
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Extension version: 2025.4.0
VS Code version: Code 1.99.3 (17baf841131aa23349f217ca7c570c76ee87b957, 2025-04-15T23:18:46.076Z)
OS version: Linux x64 6.14.2-300.fc42.x86_64
Modes:

A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
pythonrstrctxt:31112756
nativeloc1:31192215
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
hdaa2157:31222309
copilot_t_ci:31222730
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
31787653:31262186
3e8i5726:31271747
996jf627:31283433
useunpkgapi:31292914
7bj51361:31289155
747dc170:31275177
g20af354:31278749
aj953862:31281341
generatesymbolc:31292703
convertfstringf:31292704
gendocf:31292707

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions