Skip to content

vscode reports incorrect python version #25008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
erentar opened this issue Apr 23, 2025 · 4 comments
Closed

vscode reports incorrect python version #25008

erentar opened this issue Apr 23, 2025 · 4 comments
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@erentar
Copy link

erentar commented Apr 23, 2025

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

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Apr 23, 2025
@karthiknadig
Copy link
Member

@erentar Can you share your logs? This looks like it might be using js locator.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Apr 23, 2025
@erentar
Copy link
Author

erentar commented Apr 24, 2025

@karthiknadig this is what i get from the View>Output and filter for Python Locator

2025-04-24 05:39:57.883 [info] Starting Python Locator /home/user/.vscode/extensions/ms-python.python-2025.4.0-linux-x64/python-env-tools/bin/pet server
2025-04-24 05:39:58.498 [info] Discovered manager: (Conda) /home/user/.local/share/miniforge3/bin/conda
2025-04-24 05:39:58.501 [info] Discovered env: /home/user/.local/share/miniforge3/bin/python
2025-04-24 05:39:58.524 [info] Discovered env: /bin/python
2025-04-24 05:39:58.554 [info] Discovered env: /usr/bin/python
2025-04-24 05:39:58.586 [info] Discovered env: /bin/python2
2025-04-24 05:39:58.603 [info] Discovered env: /bin/python3.10
2025-04-24 05:39:58.606 [info] Discovered env: /bin/python3.11
2025-04-24 05:39:58.610 [info] Discovered env: /bin/python3.6
2025-04-24 05:39:58.622 [info] Discovered env: /bin/python3.7
2025-04-24 05:39:58.630 [info] Discovered env: /bin/python3.8
2025-04-24 05:39:58.672 [info] Discovered env: /bin/python3.9
2025-04-24 05:39:58.752 [info] Resolved Python Environment /usr/bin/python
2025-04-24 05:40:03.337 [info] Locator Conda took 731.039635ms
2025-04-24 05:40:03.338 [info] Locator Homebrew took 25.63167ms
2025-04-24 05:40:03.338 [info] Locator LinuxGlobal took 1.632894949s
2025-04-24 05:40:03.338 [info] Locator PipEnv took 183.725µs
2025-04-24 05:40:03.348 [info] Locator Pixi took 42.051µs
2025-04-24 05:40:03.355 [info] Locator Poetry took 3.015992ms
2025-04-24 05:40:03.366 [info] Locator PyEnv took 359.298µs
2025-04-24 05:40:03.366 [info] Locator Venv took 77.809µs
2025-04-24 05:40:03.367 [info] Locator VirtualEnv took 55.352µs
2025-04-24 05:40:03.368 [info] Locator VirtualEnvWrapper took 78.873µs
2025-04-24 05:40:03.381 [info] Locator GlobalVirtualEnvs took 221.30262ms
2025-04-24 05:40:03.383 [info] Locator Locators took 1.645578419s
2025-04-24 05:40:03.385 [info] Locator Path took 2.947150197s
2025-04-24 05:40:03.400 [info] Locator Workspaces took 307.740747ms
2025-04-24 05:40:03.430 [info] Refresh completed in 2951ms

if you need some other log you will have to tell me how to get it

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Apr 24, 2025
@karthiknadig
Copy link
Member

@erentar Try running this command "Python: Clear Cache and Reload Window". It should clear anything that might be coming from cache.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Apr 24, 2025
@erentar
Copy link
Author

erentar commented Apr 24, 2025

@karthiknadig that did the trick, thank you

@erentar erentar closed this as completed Apr 24, 2025
@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants