Skip to content
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

Wrong python version displayed for venv #243576

Open
JohnAtl opened this issue Mar 14, 2025 · 1 comment
Open

Wrong python version displayed for venv #243576

JohnAtl opened this issue Mar 14, 2025 · 1 comment
Assignees

Comments

@JohnAtl
Copy link

JohnAtl commented Mar 14, 2025

Type: Bug

I use uv to create my venvs.
I have requires-python = "==3.12.*" in my pyproject.toml.
I can create and activate the environment.
python --version says "Python 3.12.9".
which python says /mypath/.venv/bin/python.
I run vscode using code ., and it activates the .venv, but the version shown is 3.11.9.
I can switch to another python, then select my venv again (which shows 3.12.9 in the list), and again, it says 3.11.9.
I've verified that python.defaultInterpreterPath is set to /mypath/.venv.
If I run python --version in the terminal in vscode, it prints the correct version, 3.12.9.
I can run the following cells in a notebook:

!which python
# /mypath/.venv/bin/python
print(sys.version)
# 3.12.9 (main, Feb  4 2025, 14:38:38) [GCC 11.4.0]

So it appears to be using the correct venv and python version, yet the interface still shows the old version.

With a .py file open, the same behavior is seen when selecting the python version from the footerbar. The version show is Python 3.11.9 ('.venv'), yet if I print(sys.version) from a .py file, the correct 3.12.9 version is printed. Selecting the python intepreter by clicking on the footerbar lists my venv with the correct version 3.12.9, but after selecting it, the footerbar still displays 3.11.9.

VS Code version: Code 1.98.0 (6609ac3, 2025-03-04T21:06:18.612Z)
OS version: Linux x64 6.12.13-200.fc41.x86_64
Modes:

System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i9-13900K (32 x 5500)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 2, 2, 2
Memory (System) 125.48GB (94.17GB free)
Process Argv --crash-reporter-id 9af3d6d8-6596-447a-874f-1c746b0e63a4
Screen Reader no
VM 0%
DESKTOP_SESSION gnome
XDG_CURRENT_DESKTOP GNOME
XDG_SESSION_DESKTOP gnome
XDG_SESSION_TYPE wayland
Extensions (36)
Extension Author (truncated) Version
Bookmarks ale 13.5.0
markdown-mermaid bie 1.27.0
catppuccin-vsc Cat 3.16.1
ruff cha 2025.18.0
githistory don 0.6.20
xml Dot 2.5.1
copilot Git 1.284.0
copilot-chat Git 0.25.1
vscode-github-actions git 0.27.1
dvc ite 1.2.27
plantuml jeb 2.18.1
rainbow-csv mec 3.18.0
git-graph mhu 1.30.0
vscode-docker ms- 1.29.4
debugpy ms- 2025.4.1
mypy-type-checker ms- 2025.2.0
pylint ms- 2025.2.0
python ms- 2025.2.0
vscode-pylance ms- 2025.3.2
jupyter ms- 2025.2.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.1.0
tensorboard ms- 2023.10.1002992421
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-containers ms- 0.401.0
remote-ssh ms- 0.118.0
remote-ssh-edit ms- 0.87.0
remote-explorer ms- 0.4.3
material-icon-theme PKi 5.20.0
vscode-xml red 0.28.0
vscode-yaml red 1.17.0
even-better-toml tam 0.21.2
gcp-switch-config tik 2.2.7
pdf tom 1.2.2
vscode-todo-highlight way 1.0.5

(2 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dwnewjupytercf:31046870
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc1:31192215
iacca1:31171482
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
8did9651:31230678
hdaa2157:31222309
copilot_t_ci:31222730
f5992895:31259995
jda6j935:31233686
bgtreat:31257678
fh1c7952:31258891
h6j33387:31256343
0339e702:31259951

Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.98.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants