Skip to content

bug with matplolib qt backend (% matplolib qt) #17115

@NuxitBrain

Description

@NuxitBrain

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

when a try to make a graph with qt backend with matplotlib, it result in a stuck windows with no graph in it. when you use the inline backend, everthing work well. similar resulat is optained when you use tk backend. exemple of code tried :

import numpy as np
import matplotlib.pyplot as plt
%matplotlib qt

range_1 = np.array([1,2,3])
fig,ax = plt.subplots()
ax.plot(range_1,range_1)
Image

VS Code Version

1.106.0 insider and 1.105.1

Jupyter Extension Version

2025.9.1 and 2025.9.0

Jupyter logs

11:15:38.603 [debug] Restart kernel command handler for Untitled-1.ipynb
11:15:39.842 [debug] restart the kernel, options.disableUI=false for Untitled-1.ipynb
11:15:39.842 [info] Restart requested Untitled-1.ipynb
11:15:39.843 [debug] Cancel pending cells
11:15:39.844 [debug] Dispose Kernel process 19832.
11:15:39.862 [info] Process Execution: c:\WINDOWS\System32\taskkill.exe /F /T /PID 19832
11:15:39.881 [info] Process Execution: ~\Documents\Data_travail\Programme\Jupiter-notebook\venv\Scripts\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
11:15:39.952 [debug] Launching kernel .jvsc74a57bd04e19e84e528612ce35f54804f8260a7dc673fb1b3e9fb50b712bccd0c7df9928.~\Documents\Data_travail\Programme\Jupiter-notebook\venv\Scripts\python.exe.~\Documents\Data_travail\Programme\Jupiter-notebook\venv\Scripts\python.exe.-m#ipykernel_launcher for Untitled-1.ipynb in ~\Documents\Data_travail\Programme\Jupiter-notebook with ports 9001, 9000, 9004, 9002, 9003
11:15:39.957 [trace] Got a response of 5464 for INITIALIZE_INTERRUPT:6
11:15:39.982 [info] Process Execution: ~\Documents\Data_travail\Programme\Jupiter-notebook\venv\Scripts\python.exe -m ipykernel_launcher --f=~\AppData\Roaming\jupyter\runtime\kernel-v30be03ad34b3aca027528aeb035bfee9f1a9ac9e0.json
    > cwd: ~\Documents\Data_travail\Programme\Jupiter-notebook
11:15:39.982 [debug] Kernel process 22596.
11:15:40.003 [debug] Waiting for Raw Session to be ready in postStartRawSession
11:15:40.003 [debug] Waiting for Raw session to be ready, status: connected
11:15:40.003 [trace] Raw session connected
11:15:40.005 [debug] Waited for Raw session to be ready & got status: connected
11:15:40.006 [debug] Successfully waited for Raw Session to be ready in postStartRawSession
11:15:40.006 [debug] Kernel status is 'unknown' before requesting kernel info and after ready
11:15:40.006 [debug] Sending request for kernelInfo
11:15:40.422 [debug] KernelProcess Exited 19832, Exit Code - 1 
11:15:40.432 [debug] Disposed Kernel process 19832.
11:15:40.433 [trace] ipykernel version & path 7.0.1, ~\Documents\Data_travail\Programme\Jupiter-notebook\venv\Lib\site-packages\ipykernel\__init__.py for ~\Documents\Data_travail\Programme\Jupiter-notebook\venv\Scripts\python.exe
11:15:40.517 [trace] Did not get a response for requestKernelInfo
11:15:40.517 [debug] Sending request for kernelInfo
11:15:40.992 [debug] Kernel output 22596: To connect another client to this kernel, use:
--existing ~\AppData\Roaming\jupyter\runtime\kernel-v30be03ad34b3aca027528aeb035bfee9f1a9ac9e0.json
11:15:41.023 [trace] Did not get a response for requestKernelInfo
11:15:41.023 [debug] Sending request for kernelInfo
11:15:41.192 [trace] Got response for requestKernelInfo
11:15:41.192 [debug] Successfully completed postStartRawSession after 3 attempt(s) in 1186ms
11:15:41.193 [info] Restarted 70d38168-663c-4c7f-ae11-cf400eda2fb3
11:15:41.194 [trace] Executing silently Code (idle) = import sys as _VSCODE_sys\nprint(_VSCODE_sys.executable); del _VSCODE_sys
11:15:41.208 [trace] Executing silently Code (completed) = import sys as _VSCODE_sys\nprint(_VSCODE_sys.executable); del _VSCODE_sys with 1 output(s)
11:15:41.209 [trace] Started running kernel initialization for Untitled-1.ipynb
11:15:41.209 [trace] Executing silently Code (idle) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy
11:15:41.217 [trace] Executing silently Code (completed) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy with 0 output(s)
11:15:41.217 [trace] Determined IPyWidgets Version as undefined
11:15:41.217 [trace] Executing silently Code (idle) = def __VSCODE_inject_module():\ndef __VSCODE_call_function(function, callback, data=None):
11:15:41.228 [trace] Executing silently Code (completed) = def __VSCODE_inject_module():\ndef __VSCODE_call_function(function, callback, data=None): with 0 output(s)
11:15:41.229 [debug] Requesting Kernel info
11:15:41.229 [trace] Got Kernel info
11:15:41.229 [trace] End running kernel initialization, now waiting for idle
11:15:41.229 [trace] Waiting for idle on (kernel): 70d38168-663c-4c7f-ae11-cf400eda2fb3 -> idle
11:15:41.229 [trace] Finished waiting for idle on (kernel): 70d38168-663c-4c7f-ae11-cf400eda2fb3 -> idle
11:15:41.229 [trace] End running kernel initialization, session is idle
11:15:41.230 [trace] Registering commtarget jupyter.widget
11:15:44.768 [debug] Handle Execution of Cells 0 for Untitled-1.ipynb
11:15:44.769 [trace] Execute Notebook Untitled-1.ipynb. Step 1
11:15:44.769 [trace] Connect to Kernel Untitled-1.ipynb. Step 2
11:15:44.769 [trace] Connected to Kernel Untitled-1.ipynb. Step 3
11:15:44.769 [trace] executeCell 0. Step 4
11:15:44.770 [trace] Cell Index:0 sent to kernel
11:15:44.773 [trace] Start cell 0 execution @ 1761297344772 (clear output)
11:15:44.773 [debug] Kernel acknowledged execution of cell 0 @ 1761297344772
11:15:45.462 [trace] Cell 0 completed in 0.69s (start: 1761297344772, end: 1761297345462)
11:15:45.462 [trace] Cell 0 executed successfully
11:15:46.709 [debug] Handle Execution of Cells 1 for Untitled-1.ipynb
11:15:46.710 [trace] Execute Notebook Untitled-1.ipynb. Step 1
11:15:46.710 [trace] Connect to Kernel Untitled-1.ipynb. Step 2
11:15:46.710 [trace] Connected to Kernel Untitled-1.ipynb. Step 3
11:15:46.711 [trace] executeCell 1. Step 4
11:15:46.711 [trace] Cell Index:1 sent to kernel
11:15:46.716 [trace] Start cell 1 execution @ 1761297346716 (clear output)
11:15:46.716 [debug] Kernel acknowledged execution of cell 1 @ 1761297346716
11:15:46.941 [trace] Cell 1 completed in 0.224s (start: 1761297346716, end: 1761297346940)
11:15:46.942 [trace] Cell 1 executed successfully
11:15:53.358 [debug] KernelProcess Exited 22596, Exit Code - null 
11:15:53.359 [error] Disposing session as kernel process died ExitCode: undefined, Reason: 
11:15:53.359 [debug] Dispose Kernel process 22596.
11:15:53.369 [debug] Disposed Kernel process 22596.
11:15:53.371 [trace] Start cell 1 execution @ 1761297346716
11:15:53.398 [trace] Cell 1 completed in -1761297346.716s (start: 1761297346716, end: undefined)

Coding Language and Runtime Version

python 3.13.7

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions