Sphere
Log in Join
☆ 5

VS Code shows the wrong Python version for my venv

Terminal shows Python 3.12 when I activate my venv manually, but the Run button uses 3.10. I selected the interpreter in the bottom right and it still reverts.

⚑ Report

3 replies

☆ 0
A Amir ·2026-09-30#1

Check python.defaultInterpreterPath in settings. VS Code may be picking a workspace setting over the interpreter you selected.

⚑ Report
☆ 0
C Chloe ·2026-09-30#2

I am working inside WSL. The venv was created in the Linux filesystem, not under /mnt/c.

⚑ Report
☆ 0
C Clara ·2026-10-01#3

Good, that is the right place. Set the interpreter to /home/you/project/.venv/bin/python explicitly and reload the window. Select Interpreter stores a per-workspace path and sometimes loses it after a WSL restart.

⚑ Report
Log in to reply.