Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matplotlib can not show in the debug #1666

Closed
pcasl opened this issue Sep 5, 2024 · 5 comments
Closed

matplotlib can not show in the debug #1666

pcasl opened this issue Sep 5, 2024 · 5 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@pcasl
Copy link

pcasl commented Sep 5, 2024

Type: Bug

Behaviour

run the plt.plot ok, but in the debug mode there is not figure pop up

Python 3.12.5
Mac mini M2

Steps to reproduce:

import numpy as np
import matplotlib.pyplot as plt
print("Hello, World!")
plt.plot(np.random.randn(1000).cumsum())
plt.show()
print("Goodbye, World!")

set a breakpoint on line 3, then use python debug and step over the above code. No figure pops up. In contrast, run the code with breakpoint in vscode or use the default IDLE with breakpoints, the figure works well.

Extension version: 2024.10.0
VS Code version: Code 1.92.2 (Universal) (fee1edb8d6d72a0ddff41e5f71a671c23ed924b9, 2024-08-14T17:29:30.058Z)
OS version: Darwin arm64 23.6.0
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.5
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Unknown
System Info
Item Value
CPUs Apple M2 (8 x 2400)
GPU Status 2d_canvas: enabled
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
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.31GB free)
Process Argv --crash-reporter-id 00e935d1-bbac-4f61-be00-78c721917538
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
vscaac:30438847
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonnoceb:30805159
asynctok:30898717
pythonregdiag2:30936856
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
jg8ic977:31013176
a69g1124:31058053
dvdeprecation:31068756
dwnewjupyter:31046869
impr_priority:31102340
nativerepl1:31104043
refactort:31108082
pythonrstrctxt:31112756
wkspc-onlycs-c:31111717
wkspc-ranged-t:31125599
pme_test_c:31118331
fje88620:31121564
aajjf12562:31125793

@pcasl
Copy link
Author

pcasl commented Sep 5, 2024

more accurately, the figure icon shows up, but no figure.

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python-debugger Sep 5, 2024
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Sep 5, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Sep 5, 2024

This is likely caused by either Python 3.12 or your version of matplotlib. Debugpy hasn't been updated to handle matplotlib 3.9 yet (see this issue: #1633).

Python 3.12 support is also not finished yet. See this issue:
#1640

I would try 3.11 or an earlier version of matplotlib.

@rchiodo rchiodo closed this as completed Sep 5, 2024
@mariuswallraff
Copy link

mariuswallraff commented Oct 2, 2024

Hey, I know you marked this as completed, but what's the status here? You marked #1640 as completed last week, and according to the changelog, debugpy fully supports Python 3.12 since v1.8.1.

We are still encountering this problem while using MS Python Debugger in its pre-release version v2024.11.2024092501 in VS Code. I assume it is using debugpy v1.8.6; I can only guess because I cannot find this tag in their GitHub, but https://github.com/microsoft/vscode-python-debugger/commits/main/debugpy_info.json was updated on 2024.09.25.

Is the fix already included in v1.8.6?

edit: The pre-release is indeed using v1.8.6.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 2, 2024

I don't believe this is fixed, it's more a duplicate of one of the bugs above. 3.12 debugging should be working now, so it's likely something specific to 3.9 which is captured in this issue here:
#1633

Which looks like somebody submitted a fix to pydevd but it hasn't been accepted yet:
fabioz/PyDev.Debugger#289

You could try making that same change in your debugpy install and see if it works for you.

@mariuswallraff
Copy link

Thanks for your fast response!

I tried the proposed fix (fabioz/PyDev.Debugger@7a63f77), but sadly it did not fix the issue for me; I couldn't notice any differences. Will also post in the other thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants