Closed IvanCobotic closed 3 weeks ago
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
import moderngl_window as mglw
import matplotlib
matplotlib.use('TkAgg')
class Test(mglw.WindowConfig):
def __init__(self, **kwargs):
super().__init__(**kwargs)
def render(self, time: float, frametime: float):
pass
mglw.run_window_config(Test)
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.
@int19h do you know what is happening?
Thanks for your bug report, that is manage by debugpy, could you fill an issue there?
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:
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
configuration``` "version": "0.2.0", "configurations": [ { "name": "Python Debugger: Current File", "type": "debugpy", "request": "launch", "program": "${file}", "console": "integratedTerminal", "env": {"PYTHONPATH": "${workspaceFolder}/python"} }, ```
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)``` 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 theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython 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:
System Info
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