Repository navigation
Closed
Labels
Description
Issue Type: Bug
Plot is not getting displayed in vscode
To reprouce
import matplotlib
matplotlib.use('TkAgg') # not working even with default 'agg'
from matplotlib import pyplot as plt
plt.figure()
#plt.bar(foo,bar)
plt.show()
VS Code version: Code 1.58.1 (2aeda6b18e13c4f4f9edf6667158a6b8d408874b, 2021-07-13T06:58:28.115Z)
OS version: Windows_NT x64 10.0.22000
Restricted Mode: No
Remote OS version: Linux x64 5.4.0-1051-azure
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz (8 x 2112) |
| GPU Status | 2d_canvas: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: enabled_on video_decode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 15.75GB (1.99GB free) |
| Process Argv | --open-url --crash-reporter-id bb5a6bf5-d714-48a5-9eba-811de0544190 -- vscode://ms-toolsai.vscode-ai/computeInstance/remote?computeId=/subscriptions/da9091ec-d18f-456c-9c21-5783ee7f4645/resourceGroups/bkuriachan-rg/providers/Microsoft.MachineLearningServices/workspaces/crop-classification-aml/computes/crop-classification-cpu&sessionId=EchP7 |
| Screen Reader | no |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | Azure ML: crop-classification-cpu |
| OS | Linux x64 5.4.0-1051-azure |
| CPUs | Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz (4 x 2593) |
| Memory (System) | 27.43GB (21.37GB free) |
| VM | 0% |
Extensions (11)
| Extension | Author (truncated) | Version |
|---|---|---|
| vscode-ai-remote | ms- | 0.4.0 |
| remote-containers | ms- | 0.187.0 |
| remote-wsl | ms- | 0.58.2 |
| notepadplusplus-keybindings | ms- | 1.0.7 |
| vscode-icons | vsc | 11.5.0 |
| python | ms- | 2021.6.944021595 |
| vscode-pylance | ms- | 2021.7.3 |
| jupyter | ms- | 2021.8.1013163132 |
| vscode-ai | ms- | 0.6.24 |
| vscode-ai-remote | ms- | 0.4.0 |
| azure-account | ms- | 0.9.8 |
A/B Experiments
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
vspor879:30202332
vspor708:30202333
vspor363:30204092
vspre833:30321513
vshan820:30294714
vscus158:30321503
vscod805cf:30301675
bridge0708:30335490
Activity
bkuriach commentedon Jul 15, 2021
Using VSCode from AML
kieferrm commentedon Jul 17, 2021
This is code in a normal python file, a notebook? Pls give us the steps to reproduce the problem.
kieferrm commentedon Jul 17, 2021
/needsMoreInfo
vscode-triage-bot commentedon Jul 17, 2021
Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.
Happy Coding!
bkuriach commentedon Jul 19, 2021
This is normal python. Plots are working fine in notebooks.
To reproduce
import matplotlib
matplotlib.use('TkAgg') # not working even with default 'agg'
from matplotlib import pyplot as plt
plt.figure()
#plt.bar(foo,bar)
plt.show()
karthiknadig commentedon Jul 19, 2021
Binil Kuriachan (@bkuriach) Is this when debugging?
bkuriach commentedon Jul 19, 2021
No, in normal execution (executed as block using shift+enter).
Like I said before, I am Using VSCode from AML.
karthiknadig commentedon Jul 19, 2021
Binil Kuriachan (@bkuriach) I asked about debugging because we recently addressed an issue with debugging and plotting. Can you describe when you mean by running. Are you executing the script manually by typing
python <script-path>in VS Code terminal? or are you running using a UI? If you are using the UI, are you using a virtual environment?karthiknadig commentedon Jul 19, 2021
Do you get a different result running this from VS Code terminal and terminal outside of VS Code?
MangoSister commentedon Jul 23, 2021
Karthik Nadig (@karthiknadig) Sorry for hijacking the thread, but I seem to experience what you described: When I debug a script inside VSCode (UI: run->start debugging, or press F5), it seems to force the pyplot interactive mode to be on with the log "Backend Qt5Agg is interactive backend. Turning interactive mode on." Then
plt.show()instantly returns. If I run the same script outside VSCode then it works fine. I am using a conda environment. My python extension version is v2021.7.1060902895, and VSCode version 1.58.2. Has this already been fixed?karthiknadig commentedon Jul 24, 2021
MangoSister Do you see a difference if you run with
Ctrl+F5(i.e, Run without debugging)?MangoSister commentedon Jul 24, 2021
Karthik Nadig (@karthiknadig)
Ctrl+F5works fine. Also, not sure but I think even when running withF5, the problem only happens if you actually set a breakpoint.bkuriach commentedon Aug 7, 2021
To reproduce the issue, please execute below code in block (Shift+Enter), I don't see the plot. (VSCODE from Azure Machine Learning)
bkuriach commentedon Oct 7, 2021
Karthik Nadig (@karthiknadig): Still facing the issue.. Please let me know if you need any more details. I have provided steps to reproduce the issue (make sure you are using AML remote extension and it is connected to AML Compute). Its not in debug mode
karthiknadig commentedon Dec 2, 2021
This is a duplicate of microsoft/vscode-tools-for-ai#1297