Skip to content

python.DefaultInterpreterPath not working #25756

@trent-abc

Description

@trent-abc

Type: Bug

Behaviour

If I manually run steps:

  • Open Command Palette in VS Code (Cmd+Shift+P)
  • Click on "Python: Select Interpreter"
  • Click on ⚙️ Use Python from python.defaultInterpreterPath setting ./.pixi/envs/default/bin/python

That works, but if I want to use a settings file instead, my settings is ignored (project_dir/.vscode/settings.json):

cat .vscode/settings.json # I also modified /Library/Application\ Support/Code/User/settings.json
{
    "python.defaultInterpreterPath": "/some-path/.pixi/envs/default/bin/python"
}
# python --version
Python 3.11.13

In the output/python terminal I get:

2026-01-30 16:16:30.383 [info] Active interpreter [/some-path]:  /opt/homebrew/bin/python3.10

If I uninstall that version of python via brew I get /usr/bin/python3 instead. Why isn't vscode adhering to my settings.json?

Steps to reproduce:

How to repro

  1. Clone the repo
git clone git@github.com:trent-abc/pixi-vscode-imports.git
  1. install pixi - https://pixi.prefix.dev/latest/installation/

  2. Install pixi deps, and modify your python.defaultInterpreterPath

cd pixi-vscode-imports && pixi install
sed -i "s=/some-path="$(pwd)"=g" .vscode/settings.json
  1. Open vscode, make sure Python and Pylance extensions are installed and view repro.py.

Import "attrs" could not be resolvedPylancereportMissingImports

  1. See that it's loading the wrong version of python in vscode view

view -> output -> Python

  1. Command + Shift + P -> Select default python interpreter. Notice that
    ⚙️ Use Python from python.defaultInterpreterPath setting is not selected by default, but instead a Global value of something else is used.

Diagnostic data

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

2026-02-02 09:57:48.101 [info] Starting Pylance language server.
2026-02-02 09:58:56.636 [info] Native locator: Refresh started
2026-02-02 09:58:56.663 [info] Active interpreter [global]:  /opt/homebrew/bin/python3.10
2026-02-02 09:58:56.691 [info] Native locator: Refresh finished in 55 ms

Extension version: 2026.0.0
VS Code version: Code 1.108.2 (Universal) (c9d77990917f3102ada88be140d28b038d1dd7c7, 2026-01-21T13:52:09.270Z)
OS version: Darwin arm64 25.2.0
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.19.final.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
copilot-chat Git 0.33.5
debugpy ms- 2025.18.0
direnv mkh 0.17.0
js-debug ms- 1.105.0
js-debug-companion ms- 1.1.3
jupyter ms- 2025.9.1
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.3.0
python ms- 2026.0.0
remote-containers ms- 0.437.0
ruff cha 2026.34.0
test-adapter-converter ms- 0.2.1
vscode-containers ms- 2.4.0
vscode-docker ms- 2.0.0
vscode-js-profile-table ms- 1.0.10
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-kubernetes-tools ms- 1.3.29
vscode-pylance ms- 2025.10.4
vscode-python-envs ms- 1.16.0
vscode-python-test-adapter lit 0.8.2
vscode-test-explorer hbe 2.22.1
vscode-yaml red 1.19.1
System Info
Item Value
CPUs Apple M4 Pro (12 x 2400)
GPU Status 2d_canvas: enabled
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
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 5, 4, 5
Memory (System) 48.00GB (8.72GB free)
Process Argv --crash-reporter-id 60d56ebd-60f6-48b4-ae92-32687118ece6
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31436602
aj953862:31281341
b6b4d950:31327385
6abeh943:31336334
envsactivate1:31353494
cloudbuttont:31379625
aihoversummaries_t:31453032
3efgi100_wstrepl:31403338
use-responses-api:31390855
je187915:31401257
ec5jj548:31422691
cmp-ext-treat:31426748
cp_cls_c_966_ss:31454199
c0683394:31419495
ge8j1254_inline_auto_hint_haiku:31431912
nes-autoexp-10:31446583
a5gib710:31434435
5j92g670_sonnet:31455624
7a04d226_do_not_restore_last_panel_session:31438103
anthropic_thinking_t:31455736
h0hdh950:31428394
cp_cls_c_1081:31454833
copilot-nes-oct-trt:31432596
nes-jmp-himalia-001:31437105
nes-set-to-on:31441941
nes-eol-debounce-on:31442598
a43f0574:31442827
nes-conv-1-3:31447850

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