Repository navigation
Fix Pixi kernel activation for System/Unknown interpreters - #26198
Merged
Stella Huang (StellaHuang95) merged 1 commit intoOct 5, 2026
Merged
Stella Huang (StellaHuang95) merged 1 commit into
Stella Huang (StellaHuang95) merged 1 commit into
Conversation
Stella Huang (StellaHuang95)
requested review from
Eduardo Villalpando Mello (edvilme) and
Eleanor Boyd (eleanorjboyd)
October 5, 2026 20:20
Use non-interactive Pixi activation for mislabeled environments and require exact reported prefixes in the metadata-free resolver. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Stella Huang (StellaHuang95)
force-pushed
the
fix-pixi-kernel-activation
branch
from
October 5, 2026 20:22
5c6a12e to
55cd9d8
Compare
Rich Chiodo (rchiodo)
approved these changes
Oct 5, 2026
Stella Huang (StellaHuang95)
enabled auto-merge (squash)
October 5, 2026 20:33
auto-merge was automatically disabled
October 5, 2026 22:54
Pull request was closed
Eduardo Villalpando Mello (edvilme)
approved these changes
Oct 5, 2026
Stella Huang (StellaHuang95)
merged commit Oct 5, 2026
d0d4ded
into
microsoft:main
82 of 94 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes microsoft/vscode-python-environments#1825.
Summary
The Python Environments extension can resolve a Pixi interpreter through its System fallback. This skips Python's type-gated
pixi runpath when collecting activation variables and falls through to an interactivepixi shellcommand. The collection can time out after 30 seconds, leaving Jupyter to launch an unactivated kernel and causing the reported Windows Matplotlib crash.Use the existing non-interactive Pixi activation path for interpreters labeled
SystemorUnknownwhen the resolver identifies their environment as Pixi. Harden the metadata-free resolver so a similarly nested, non-Pixi interpreter cannot be mistaken for a project environment.Changes
SystemandUnknown, alongsidePixi, to call the existing Pixi command resolver during background environment-variable collection. Preserve the existing fallback when no Pixi command is returned.pixi info --json, using the existing platform-aware path comparison. Use that matched environment's reported name rather than the directory basename.No Python Environments extension changes, new settings, or public API changes are required.
Validation
plt.scatter()/plt.show()cell in the actual VS Code Interactive Window with Python Environments enabled. The plot rendered, and a follow-up cell executed on the same kernel.Unknown; the Python output showedpixi run, and activation-variable collection completed in 863 ms. The follow-up cell confirmed the selected Pixi executable,PIXI_ENVIRONMENT_NAME=default, and the matchingCONDA_PREFIX.Manual setup: Windows x64, VS Code 1.139.0, Python Environments 1.39.0, Jupyter 2025.8.0, Pixi 0.76.1, Python 3.12.14, Matplotlib 3.11.2, and ipykernel 7.4.0.
Scope and review notes
This fixes background activation without treating the
Systemlabel itself as evidence of Pixi ownership. The shared metadata-free resolver now also rejects unreported prefixes for its other callers.The existing metadata route still trusts prefix-local Pixi metadata. Filesystem-alias resolution and malformed/stale metadata handling are outside this change.
The manual run used the fixed VSIX, not an unpatched-versus-patched UI comparison, and the extension versions are not all identical to the reporter's. Named Pixi environments and metadata-free detection cases are covered by unit tests rather than this UI walkthrough.