You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import moderngl_window as mglw
import matplotlib
class Test(mglw.WindowConfig):
def __init__(self, **kwargs):
super().__init__(**kwargs)
def render(self, time: float, frametime: float):
pass
mglw.run_window_config(Test)
with a breakpoint in the init of class Test, i.e. break on super().init(**kwargs), causes the debugger to break on the line, but the debugger becomes unresponsive. Its not possible to enter debug console commands or step the program.
Steps to reproduce:
I isolated the problem to moderngl_window and matplotlib.
if the import of matplotlib is removed the debugger works as expected.
I realize im using 2 packages external to VScode to reproduce this error, but my testing shows that the error only occurs on windows (on linux the debugger works fine).
I also tested with the built in python pdb debugger and the pdb debugger can break in the init function without problem. So even though two external dependencies are used, I believe the issue must be a problem with vscode debugpy on windows.
To reproduce, please run (in a virtual environment)
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
2024-04-15 22:54:55.642 [info] Send text to terminal: �
2024-04-15 22:54:55.642 [info] Send text to terminal: c:; cd 'c:\mygits\deepose'; & 'c:\mygits\deepose\.venv\Scripts\python.exe' 'c:\Users\IvanL\.vscode\extensions\ms-python.debugpy-2024.4.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher' '52449' '--' 'C:\mygits\deepose\python\experimental\debugger_issue.py'
Output for Python Debugger in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python Debugger)
2024-04-15 22:53:16.347 [info] DAP Server launched with command: c:\mygits\deepose\.venv\Scripts\python.exe c:\Users\IvanL\.vscode\extensions\ms-python.debugpy-2024.4.0-win32-x64\bundled\libs\debugpy\adapter
# Behaviour
Debugger freezes. Debug console input is ignored and the step/ play etc debug commands stop working.
Extension version: 2024.4.0
VS Code version: Code 1.88.1 (e170252f762678dec6ca2cc69aba1570769a5d39, 2024-04-10T17:41:02.734Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Python version (& distribution if applicable, e.g. Anaconda): 3.11.9
Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): VirtualEnvironment
System Info
Item
Value
CPUs
11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 x 2803)
I made some more testing and found that the freezing of vscode python debugger is related to what backend is used in the matplotlib package. The default backend of matplotlib is QtAgg. If a different backend is used, such as TkAgg
vscode can break correctly on the
super().init(**kwargs)
line.
I can use TkAgg as the backend for matplotlib, so this workaround solves my issue at the moment. It still seems weird to me though that the usage of QtAgg backend in Matplotlib should cause the vscode debugger to become unresponsive.
Type: Bug
Behaviour
Running the following code
with a breakpoint in the init of class Test, i.e. break on super().init(**kwargs), causes the debugger to break on the line, but the debugger becomes unresponsive. Its not possible to enter debug console commands or step the program.
Steps to reproduce:
if the import of matplotlib is removed the debugger works as expected.
I realize im using 2 packages external to VScode to reproduce this error, but my testing shows that the error only occurs on windows (on linux the debugger works fine).
I also tested with the built in python pdb debugger and the pdb debugger can break in the init function without problem. So even though two external dependencies are used, I believe the issue must be a problem with vscode debugpy on windows.
To reproduce, please run (in a virtual environment)
my python version is 3.11, Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe
Diagnostic data
launch.json
configurationOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output for
Python Debugger
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython Debugger
)Debugger freezes. Debug console input is ignored and the step/ play etc debug commands stop working.
Extension version: 2024.4.0
VS Code version: Code 1.88.1 (e170252f762678dec6ca2cc69aba1570769a5d39, 2024-04-10T17:41:02.734Z)
OS version: Windows_NT x64 10.0.22631
Modes:
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
A/B Experiments
The text was updated successfully, but these errors were encountered: