Skip to content

Python native REPL ignoring workspace interpreter #992

Closed
microsoft/vscode-python
#25763

Description

Type: Bug

After updating VS Code today, the Python native REPL no longer uses the selected Python interpreter/virtual environment for the workspace. Instead it always uses the global default interpreter path (which you can see by running sys.executable). This is a problem because I need the native REPL to use virtual environments for specific projects.

Extension version: 2025.10.1
VS Code version: Code 1.102.2 (c306e94f98122556ca081f527b466015e1bc37b0, 2025-07-22T12:15:48.520Z)
OS version: Windows_NT x64 10.0.26100
Modes:

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


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
debugpy ms- 2025.10.0
even-better-toml tam 0.21.2
intellicode-api-usage-examples Vis 0.2.9
java red 1.43.1
js-debug ms- 1.102.0
js-debug-companion ms- 1.1.3
jupyter ms- 2025.6.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.3.0
python ms- 2025.10.1
r REd 2.8.6
r-syntax REd 0.1.3
rainbow-csv mec 3.20.0
vscode-gradle vsc 3.16.4
vscode-java-debug vsc 0.58.2
vscode-java-dependency vsc 0.24.1
vscode-java-pack vsc 0.29.2
vscode-java-test vsc 0.43.1
vscode-js-profile-table ms- 1.0.10
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-maven vsc 0.44.0
vscode-pylance ms- 2025.7.1
vscode-python-envs ms- 1.2.0
vscodeintellicode Vis 1.3.2
System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i7-1365U (12 x 2688)
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: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.67GB (16.35GB free)
Process Argv --crash-reporter-id bad86640-caad-401d-8273-da88a560591e
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
binariesv615:30325510
2e7ec940:31000449
nativeloc1:31344060
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
hdaa2157:31222309
copilot_t_ci:31333650
e5gg6876:31282496
pythoneinst12:31285622
c7cif404:31314491
pythonpulldiag:31343502
996jf627:31283433
pythonrdcb7:31342333
usemplatestapi:31297334
0aa6g176:31307128
747dc170:31275177
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
pylancequickfixf:31350060
9d2cg352:31346308
convertlamdat:31350063
usemarketplace:31343026
nesew2to5:31336538
agentclaude:31335814
nes-diff-11:31337487
replacestringexc:31350595
nes-set-on:31340697
6abeh943:31336334
envsactivate1:31353494
yijiwantestdri0626-c:31336931
0927b901:31350571
ji9b5146:31348712
45650338:31356125
0cj2b977:31352657

Activity

  1. anthonykim1 commented on Aug 6, 2025

    @anthonykim1
    Contributor

    Do you get different behavior when you add python.useEnvironmentsExtension": false, to your settings.json

  2. github-actions commented on Sep 6, 2025

    @github-actions

    Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

    Happy Coding!

  3. jevogel commented on Oct 23, 2025

    @jevogel

    I just encountered this issue myself. If python.useEnvironmentsExtension is set to true (the default) and I open the native REPL, sys.prefix returns /usr, implying the REPL is not running inside a virtual environment. If I set it to false as requested, then sys.prefix resolves to my .venv directory as expected.

  4. matthewgson commented on Nov 10, 2025

    @matthewgson

    I also confirmed that now vscode honors the default python interepreter path setup when python.useEnvironmentExtension: false.

  5. anthonykim1 commented on Nov 10, 2025

    @anthonykim1
    Contributor

    I think there has been some changes to getActiveInterpreter to use new environment extension API recently. /cc Eleanor Boyd (@eleanorjboyd)
    Can you guys try with python.useEnvironmentsExtension to true, with the latest pre-release of env extension?
    We want this to work regardless of env extension presence.

  6. vs-code-engineering commented on Nov 10, 2025

    @vs-code-engineering

    Please diagnose the root cause of the issue by running the command F1 > Help: Troubleshoot Issue and following the instructions. Once you have done that, please update the issue with the results.

    Happy Coding!

  7. 14 remaining items

  8. added this to the milestone on Dec 15, 2025
  9. removed this from the milestone on Jan 5, 2026
  10. locked as resolved and limited conversation to collaborators on Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentEnvironment, interpreter related issues.bugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priority

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions