Open pietro1000 opened 6 months ago
@pietro1000 Please can you hide the variable viewer and see if this makes a difference. The Jupyter variables viewer is either displayed on your left (Debugger Panel) or on the bottom Panel. You can optionally hide/collapse both side bar and the output panels. This should make a difference. Please let me know.
Based on the following logs Cell 3 was sent at 17:24:07 & the kernel received the cell at 17:24:27 Looks like the kernel is busy.
17:24:07.873 [info] Generated code for 3 = <ipython-input-3-580a1d29c2ff> with 9 lines
17:24:07.882 [debug] Cell Index:3 sent to kernel
17:24:09.141 [debug] Executing silently Code (busy) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info a
17:24:09.144 [debug] Executing silently Code (busy) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info a
17:24:09.145 [debug] Executing silently Code (busy) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info a
17:24:10.357 [debug] Executing silently Code (busy) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info a
17:24:10.358 [debug] Executing silently Code (busy) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info a
17:24:10.361 [debug] Executing silently Code (busy) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info a
17:24:11.781 [debug] Executing silently Code (busy) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info a
17:24:27.011 [debug] Start cell 3 execution @ 1709677467011 (clear output)
17:24:27.011 [info] Kernel acknowledged execution of cell 3 @ 1709677467011
I have hidden the Jupyter variable viewer, and this helps—thank you so much! Is it possible to add back the variables viewer without causing the kernel to get stuck retrieving variables? I do not understand why this happens; the code I am trying to run only uses 5 data frames
You could try the new built-in variable view with the setting "notebook.experimental.variablesView": true
- A tree view with the variables should show up in the sidebar debug panel once you execute a cell. I'd be curious to see if that handles your scenario any better.
I'm not sure why it would take so long just to gather the variable info for 5 dataframes though, that is pretty strange. Does it repro for something simple like this:
df1 = pd.DataFrame({"Name": ["Alice", "Bob", "Charlie"],"Age": [25, 30, 35],"Gender": ["F", "M", "M"],})
df2 = pd.DataFrame({"Name": ["Alice", "Bob", "Charlie"],"Age": [25, 30, 35],"Gender": ["F", "M", "M"],})
df3 = pd.DataFrame({"Name": ["Alice", "Bob", "Charlie"],"Age": [25, 30, 35],"Gender": ["F", "M", "M"],})
df4 = pd.DataFrame({"Name": ["Alice", "Bob", "Charlie"],"Age": [25, 30, 35],"Gender": ["F", "M", "M"],})
df5 = pd.DataFrame({"Name": ["Alice", "Bob", "Charlie"],"Age": [25, 30, 35],"Gender": ["F", "M", "M"],})
@amunger, thank you so much for your help!
I've set "notebook.experimental.variablesView": true
, and it works well. The variables are displayed in the left panel under "notebook variables" and the code executes without issues. However, I encounter a problem when I click on any of the data frames in the notebook variables panel: the kernel freezes. I suspect the issue arises because the data frames I'm working with are relatively large for Jupyter, despite consuming less than one-third of available RAM.
This issue does not occur with the example you provided or with smaller data frames.
Do you have any suggestions for using the interactive window with large datasets? Are there alternatives to closing the variables viewer or running the code through the Python debugger? Many thanks!
Thanks for the info, very helpful for us to test out the limitations. It sounds like were trying to pass too much data to the context menu. Are you right clicking to try and get to the dataviewer for a dataframe? That isn't implemented yet for the new view.
I don't have a workaround for you currently, but we are trying to improve this area so hopefully it'll be solved soon.
I clicked on the dropdown menu next to the dataframe name out of curiosity to see what information was available. But, doing so caused the kernel to freeze. The screenshot below shows where it got stuck when I clicked on the ">" next to bond_char.
Also, if I leave the variables view from the debugger open without clicking on any variable, the Jupyter log still keeps printing Executing silently Code (completed) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info with 1 output(s)
, but this time it doesn’t seem to interfere with the kernel's execution speed.
I also noticed that with the Jupyter variable viewer open the kernel uses significant CPU even while idle. Switching to the debugger's variables viewer solves this issue.
So the debugger variables viewer definitely helps! Thank you again!
Applies To
What happened?
When I run my script in the interactive window, the first few cells execute normally, but subsequent cells do not run. The Jupyter output acknowledges that the cell has been sent to the kernel but never starts execution. At the same time, the Jupyter output is filled with the following message repeated multiple times: *[debug] Executing silently Code (busy) = def _VSCODE_getVariable(what_to_get, is_debugging, args): # Query Jupyter server for the info**
VS Code Version
Visual Studio Code (1.87.0, undefined, desktop)
Jupyter Extension Version
Jupyter Extension Version: 2024.2.0.
Jupyter logs
Coding Language and Runtime Version
Python 3.9.18
Language Extension Version (if applicable)
Python Extension Version: 2024.2.1.
Anaconda Version (if applicable)
No response
Running Jupyter locally or remotely?
Local