Skip to content

kernel crashed when plt.plot() #1825

Description

Description

The Python Environments extension crashes the Jupyter kernel when executing code that calls plt.show(), using a Pixi-managed environment.

Steps to Reproduce

  1. Generate the environment from this pixi.toml file:
[workspace]
authors = ["Ignacio Sallaberry <sallaberry.ignacio@gmail.com>"]
channels = ["conda-forge"]
name = "problem"
platforms = ["win-64"]
version = "0.1.0"

[tasks]

[dependencies]
matplotlib = ">=3.11.2,<4"
  1. Create a file.py as following:
#%%
import matplotlib.pyplot as plt
plt.scatter([1,2,3], [1,2,3])
plt.show()
  1. Select the cell and press Shift+Enter in VS Code.

Expected behavior

The plot window opens normally.

Actual behavior

The kernel crashes with the following error:

The Kernel crashed while executing code in the current cell or a previous cell.
Please review the code in the cell(s) to identify a possible cause of the failure.
Click here for more info.
View Jupyter log for further details.

Note: running the same script directly from a terminal with pixi run python file.py works correctly — the issue only appears in the VS Code Interactive Window with the Python Environments extension enabled.

Environment

  • VS Code 1.139.1
  • Jupyter Extension 2025.9.1
  • Python Extension 2026.4.0
  • Python Environment Extension 1.38.0
  • Pylance Extension not installed
  • Pixi 0.76.1
  • Platform: win32 (x64)
  • Python 3.12.14 (Pixi env)

Jupyter log

Visual Studio Code (1.139.1, undefined, desktop)
Jupyter Extension Version: 2025.9.1.
Python Extension Version: 2026.4.0.
Python Environment Extension Version: 1.38.0.
Pylance Extension not installed.
Platform: win32 (x64).
Home = c:\Users\ignacio
Temp Storage folder ~\AppData\Roaming\Code\User\globalStorage\ms-toolsai.jupyter\version-2025.9.1
Multiple Workspace folders opened ~\Desktop\LDSM, ~\Desktop\problem
16:13:01.926 [warn] No interpreter with path ~\Desktop\LDSM\SNN_Models.pixi\envs\default\python.exe found in Python API, will convert Uri path to string as Id ~\Desktop\LDSM\SNN_Models.pixi\envs\default\python.exe
16:13:01.926 [warn] No interpreter with path ~\Desktop\LDSM\SNN_Models.pixi\envs\default\python.EXE found in Python API, will convert Uri path to string as Id ~\Desktop\LDSM\SNN_Models.pixi\envs\default\python.EXE
16:13:05.472 [info] Starting Kernel (Python Path: ~\Desktop\LDSM\SNN_Models.pixi\envs\default\python.exe, Unknown, 3.12.14) for 'Interactive-2.interactive' (disableUI=false)
16:13:35.237 [warn] Failed to get activated env vars for ~\Desktop\LDSM\SNN_Models.pixi\envs\default\python.exe in 30203ms
16:13:35.245 [info] Process Execution: ~\Desktop\LDSM\SNN_Models.pixi\envs\default\python.exe -c "import site;print("USER_BASE_VALUE");print(site.USER_SITE);print("USER_BASE_VALUE");"
16:13:35.287 [info] Process Execution: ~\Desktop\LDSM\SNN_Models.pixi\envs\default\python.exe -m pip list
16:13:35.868 [warn] Failed to get activated env vars for ~\Desktop\LDSM\SNN_Models.pixi\envs\default\python.exe in 30155ms
16:13:35.876 [info] Process Execution: ~\Desktop\LDSM\SNN_Models.pixi\envs\default\python.exe -c "import ipykernel; print(ipykernel.version); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.file)"
16:13:35.882 [info] Process Execution: ~\Desktop\LDSM\SNN_Models.pixi\envs\default\python.exe ~.vscode\extensions\ms-toolsai.jupyter-2025.9.1-win32-x64\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 2916
> cwd: ~.vscode\extensions\ms-toolsai.jupyter-2025.9.1-win32-x64\pythonFiles\vscode_datascience_helpers
16:13:35.955 [info] Process Execution: \Desktop\LDSM\SNN_Models.pixi\envs\default\python.exe -m ipykernel_launcher --f=\AppData\Roaming\jupyter\runtime\kernel-v3ae5343d59a6b52ff8b88411b4450fbed0a18b4b7.json
> cwd: ~\Desktop\LDSM
16:13:36.605 [info] Kernel successfully started
16:13:36.611 [info] Generated code for 1 = with 4 lines
16:13:36.652 [info] Process Execution: ~\Desktop\LDSM\SNN_Models.pixi\envs\default\python.exe ~.vscode\extensions\ms-toolsai.jupyter-2025.9.1-win32-x64\pythonFiles\printJupyterDataDir.py
16:13:37.134 [error] Disposing session as kernel process died ExitCode: 3228369023, Reason: [IPKernelApp] WARNING | Kernel is running over TCP without encryption. All communication (including code and outputs) is sent in plain text and is susceptible to eavesdropping. Use IPC transport or launch with kernel manager-provisioned CurveZMQ keys to enable transport encryption.

16:13:37.513 [error] Widget Error: Failed to access CDN https://unpkg.com/ after 0 attempt(s), TypeError: Failed to fetch

Workaround

Uninstalling the Python Environments extension resolves the issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions