question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cells are not executing in interactive window

See original GitHub issue

Issue Type: Bug

  1. Create Interactive window, kernel startup looks successful
  2. run print(1) from the input box

Actual: cell is added but not run

Still repros after Reloading vscode

image

Extension version: 2022.6.1001811033 VS Code version: Code - Insiders 1.69.0-insider (e71b6105ebb4fbcfbf38a1b62bcbafdb048d3468, 2022-06-27T07:59:47.622Z) OS version: Windows_NT x64 10.0.22000 Restricted Mode: No

System Info
Item Value
CPUs Intel® Core™ i7-1065G7 CPU @ 1.30GHz (8 x 1498)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.59GB (14.72GB free)
Process Argv –folder-uri file:///c%3A/src/test/3 --crash-reporter-id 1202dc88-403d-4ebc-8393-af3551a8bd5b
Screen Reader no
VM 0%
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
vscod805cf:30301675
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30404738
wslgetstarted:30449409
vscscmwlcmt:30465136
cppdebug:30492333
pylanb8912:30496796
vsclangdf:30492506

Jupyter logs

Visual Studio Code - Insiders (1.69.0-insider, undefined, desktop)
Jupyter Extension Version: 2022.6.1001811033.
Python Extension Version: 2022.9.11791004.
Workspace folder c:\src\test\3
info 9:37:22.828: ZMQ install verified.
User belongs to experiment group 'jupyterTest'
User belongs to experiment group 'jupyterEnhancedDataViewer'
info 9:37:23.358: LSP Notebooks experiment is disabled -- not in treatment group
info 9:37:23.653: Starting Jupyter Session id = 'startUsingPythonInterpreter:.jvsc74a57bd02a8bb579a3d276ed5ddfe14b8685f1986e420a0f5c411ab8f05c20e26ae95962.c:\src\test\3\.venv7\Scripts\python.exe.c:\src\test\3\.venv7\Scripts\python.exe.-m#ipykernel_launcher' (Python Path: c:\src\test\3\.venv7, EnvType: Venv, EnvName: '.venv7', Version: 3.9.13) for 'Untitled-1.ipynb' (disableUI=true)
info 9:37:23.656: Creating raw notebook for resource 'Untitled-1.ipynb'
info 9:37:23.656: Computing working directory for resource 'Untitled-1.ipynb'
info 9:37:23.658: Starting raw kernel '.venv7 (Python 3.9.13)' for interpreter c:\src\test\3\.venv7\Scripts\python.exe
info 9:37:23.873: Kernel launching with ports 9000,9001,9002,9003,9004. Start port is 9000
info 9:37:23.919: Process Execution: > c:\src\test\3\.venv7\Scripts\python.exe -m pip list
> c:\src\test\3\.venv7\Scripts\python.exe -m pip list
info 9:37:24.148: Experiment status for python is {"enabled":true,"optInto":[],"optOutFrom":[]}
info 9:37:24.367: Process Execution: > c:\venvs\venv2\Scripts\python.exe -m pip list
> c:\venvs\venv2\Scripts\python.exe -m pip list
info 9:37:24.380: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 9:37:24.380: Find preferred kernel for Untitled-1.ipynb with metadata {"kernelspec":{"display_name":"Python 3.9.13 ('.venv7': venv)","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.9.13"},"orig_nbformat":4,"vscode":{"interpreter":{"hash":"2a8bb579a3d276ed5ddfe14b8685f1986e420a0f5c411ab8f05c20e26ae95962"}}} & preferred interpreter c:\venvs\venv2\Scripts\python.exe
info 9:37:24.386: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 9:37:24.386: Preferred kernel .jvsc74a57bd02a8bb579a3d276ed5ddfe14b8685f1986e420a0f5c411ab8f05c20e26ae95962.c:\src\test\3\.venv7\Scripts\python.exe.c:\src\test\3\.venv7\Scripts\python.exe.-m#ipykernel_launcher is exact match
info 9:37:24.388: PreferredConnection: .jvsc74a57bd02a8bb579a3d276ed5ddfe14b8685f1986e420a0f5c411ab8f05c20e26ae95962.c:\src\test\3\.venv7\Scripts\python.exe.c:\src\test\3\.venv7\Scripts\python.exe.-m#ipykernel_launcher found for NotebookDocument: Untitled-1.ipynb
info 9:37:25.226: Registering dummy command feature
info 9:37:25.752: Registering dummy command feature
info 9:37:26.184: Process Execution: > c:\src\test\3\.venv7\Scripts\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
> c:\src\test\3\.venv7\Scripts\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
info 9:37:26.189: Creating daemon process for c:\src\test\3\.venv7\Scripts\python.exe with env variables count 61
info 9:37:26.198: Process Execution: > c:\src\test\3\.venv7\Scripts\python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_interrupt_daemon -v --ppid 8260
> c:\src\test\3\.venv7\Scripts\python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_interrupt_daemon -v --ppid 8260
info 9:37:27.931: get interrupthandle daemon
info 9:37:28.120: ipykernel version 6.15.0 for c:\src\test\3\.venv7\Scripts\python.exe
info 9:37:28.121: ipykernel location c:\src\test\3\.venv7\lib\site-packages\ipykernel\__init__.py for c:\src\test\3\.venv7\Scripts\python.exe
info 9:37:28.178: Process Execution: > c:\src\test\3\.venv7\Scripts\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"2d4612c6-c830-4e02-a527-c3b700202f2a" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\aamunger\AppData\Roaming\jupyter\runtime\kernel-v2-8260mGTgtrb2b2H1.json
> c:\src\test\3\.venv7\Scripts\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"2d4612c6-c830-4e02-a527-c3b700202f2a" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\aamunger\AppData\Roaming\jupyter\runtime\kernel-v2-8260mGTgtrb2b2H1.json
info 9:37:28.178: Process Execution: cwd: c:\src\test\3
cwd: c:\src\test\3
warn 9:37:30.803: StdErr from Kernel Process c:\src\test\3\.venv7\lib\site-packages\traitlets\traitlets.py:2392: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
  warn(
c:\src\test\3\.venv7\lib\site-packages\traitlets\traitlets.py:2346: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '2d4612c6-c830-4e02-a527-c3b700202f2a' instead of 'b"2d4612c6-c830-4e02-a527-c3b700202f2a"'.
  warn(

info 9:37:30.977: Kernel Output: NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.

To read more about this, see https://github.com/ipython/ipython/issues/2049


To connect another client to this kernel, use:
    --existing c:\Users\aamunger\AppData\Roaming\jupyter\runtime\kernel-v2-8260mGTgtrb2b2H1.json

info 9:37:31.22: Started kernel .venv7 (Python 3.9.13)., (Raw session started and connected)
info 9:37:31.23: Finished connecting d7f756c4-6a36-429f-8b18-9b13695b96a6
info 9:37:31.28: Add SVG to matplotlib figure formats
info 9:37:31.29: Executing silently Code (idle) = __vsc_ipynb_file__ = "Untitled-1.ipynb"\n%config Completer.use_jedi = False\ntry:\nimport matplotli
info 9:37:32.191: Executing silently Code (completed) = __vsc_ipynb_file__ = "Untitled-1.ipynb"\n%config Completer.use_jedi = False\ntry:\nimport matplotli
info 9:37:32.192: Waiting for idle on (kernel): 0618303f-d23c-4553-be84-53ba3896f6cb -> idle
info 9:37:32.192: Finished waiting for idle on (kernel): 0618303f-d23c-4553-be84-53ba3896f6cb -> idle
info 9:37:32.199: Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
info 9:37:32.200: Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
info 9:37:34.866: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 9:37:34.866: Find preferred kernel for Untitled-1.ipynb with metadata {"kernelspec":{"display_name":"Python 3.9.13 ('.venv7': venv)","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.9.13"},"orig_nbformat":4,"vscode":{"interpreter":{"hash":"2a8bb579a3d276ed5ddfe14b8685f1986e420a0f5c411ab8f05c20e26ae95962"}}} & preferred interpreter c:\venvs\venv2\Scripts\python.exe
info 9:37:34.868: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 9:37:34.868: Preferred kernel .jvsc74a57bd02a8bb579a3d276ed5ddfe14b8685f1986e420a0f5c411ab8f05c20e26ae95962.c:\src\test\3\.venv7\Scripts\python.exe.c:\src\test\3\.venv7\Scripts\python.exe.-m#ipykernel_launcher is exact match
info 9:37:34.874: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 9:37:58.483: Starting interactive window for resource ''
info 9:37:58.556: Preferred Remote kernel for Interactive-1.interactive is undefined
info 9:37:58.749: Starting Jupyter Session id = 'startUsingPythonInterpreter:.jvsc74a57bd08ad84c22a4e7ef64d099dabd51798018458b7ea207c73b8c8dcbf4767af43b0f.c:\venvs\venv2\Scripts\python.exe.c:\venvs\venv2\Scripts\python.exe.-m#ipykernel_launcher' (Python Path: c:\venvs\venv2, EnvType: Venv, EnvName: 'venv2', Version: 3.9.13) for 'Interactive-1.interactive' (disableUI=false)
info 9:37:58.749: Creating raw notebook for resource ''
info 9:37:58.749: Computing working directory for resource ''
info 9:37:58.750: Starting raw kernel 'venv2 (Python 3.9.13)' for interpreter c:\venvs\venv2\Scripts\python.exe
info 9:37:58.884: Kernel launching with ports 9005,9006,9007,9008,9009. Start port is 9000
info 9:37:58.932: Process Execution: > c:\venvs\venv2\Scripts\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
> c:\venvs\venv2\Scripts\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
info 9:37:59.45: Creating daemon process for c:\venvs\venv2\Scripts\python.exe with env variables count 61
info 9:37:59.54: Process Execution: > c:\venvs\venv2\Scripts\python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_interrupt_daemon -v --ppid 8260
> c:\venvs\venv2\Scripts\python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_interrupt_daemon -v --ppid 8260
info 9:38:0.149: get interrupthandle daemon
info 9:38:0.160: Process Execution: > c:\venvs\venv2\Scripts\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9008 --control=9006 --hb=9005 --Session.signature_scheme="hmac-sha256" --Session.key=b"299c8486-f879-4c2d-bdc6-3d019205b8e8" --shell=9007 --transport="tcp" --iopub=9009 --f=c:\Users\aamunger\AppData\Roaming\jupyter\runtime\kernel-v2-8260IdM0LWK6Njtk.json
> c:\venvs\venv2\Scripts\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9008 --control=9006 --hb=9005 --Session.signature_scheme="hmac-sha256" --Session.key=b"299c8486-f879-4c2d-bdc6-3d019205b8e8" --shell=9007 --transport="tcp" --iopub=9009 --f=c:\Users\aamunger\AppData\Roaming\jupyter\runtime\kernel-v2-8260IdM0LWK6Njtk.json
info 9:38:0.160: Process Execution: cwd: c:\src\test\3
cwd: c:\src\test\3
info 9:38:0.406: ipykernel version 6.13.0 for c:\venvs\venv2\Scripts\python.exe
info 9:38:0.406: ipykernel location c:\venvs\venv2\lib\site-packages\ipykernel\__init__.py for c:\venvs\venv2\Scripts\python.exe
warn 9:38:1.341: StdErr from Kernel Process c:\venvs\venv2\lib\site-packages\traitlets\traitlets.py:2202: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
  warn(
c:\venvs\venv2\lib\site-packages\traitlets\traitlets.py:2157: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '299c8486-f879-4c2d-bdc6-3d019205b8e8' instead of 'b"299c8486-f879-4c2d-bdc6-3d019205b8e8"'.
  warn(

info 9:38:1.451: Kernel Output: NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.

To read more about this, see https://github.com/ipython/ipython/issues/2049


To connect another client to this kernel, use:
    --existing c:\Users\aamunger\AppData\Roaming\jupyter\runtime\kernel-v2-8260IdM0LWK6Njtk.json

info 9:38:1.606: Started kernel venv2 (Python 3.9.13)., (Raw session started and connected)
info 9:38:1.607: Finished connecting d7f756c4-6a36-429f-8b18-9b13695b96a6
info 9:38:1.609: Add SVG to matplotlib figure formats
info 9:38:1.609: Executing silently Code (idle) = import types as _VSCODE_types\nimport os\nimport hashlib as _VSCODE_hashlib\nfrom IPython import get_ip
info 9:38:2.323: Executing silently Code (completed) = import types as _VSCODE_types\nimport os\nimport hashlib as _VSCODE_hashlib\nfrom IPython import get_ip
info 9:38:2.323: Waiting for idle on (kernel): 8e03dfbb-d37f-4032-9e22-89879d8e3b6e -> idle
info 9:38:2.323: Finished waiting for idle on (kernel): 8e03dfbb-d37f-4032-9e22-89879d8e3b6e -> idle
info 9:38:2.333: Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
info 9:38:2.333: Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
info 9:38:8.485: Execute Cell 1 Interactive-1.interactive
error 9:38:8.486: Error in execution [Error: notebook controller is NOT associated to notebook: vscode-interactive:Interactive-1.interactive
	at Object.createNotebookCellExecution (c:\Users\aamunger\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:87:103975)
	at Function.create (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:2:1977649)
	at Function.getOrCreate (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:2:1977520)
	at R.createCellExecutionIfNecessary (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:33:366719)
	at R.executeCell (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:33:367205)
	at async Promise.all (index 0)
	at async R.handleExecution (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:33:363188)]
error 9:38:8.488: Error in execution (get message for cell) [Error: notebook controller is NOT associated to notebook: vscode-interactive:Interactive-1.interactive
	at Object.createNotebookCellExecution (c:\Users\aamunger\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:87:103975)
	at Function.create (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:2:1977649)
	at Function.getOrCreate (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:2:1977520)
	at R.createCellExecutionIfNecessary (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:33:366719)
	at R.executeCell (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:33:367205)
	at async Promise.all (index 0)
	at async R.handleExecution (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:33:363188)]
error 9:38:8.489: VSCodeNotebookController::handleExecution, Class name = R, completed in 5ms, has a falsy return value [Error: notebook controller is NOT associated to notebook: vscode-interactive:Interactive-1.interactive
	at Object.createNotebookCellExecution (c:\Users\aamunger\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:87:103975)
	at Function.create (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:2:1977649)
	at Function.getOrCreate (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:2:1977520)
	at t.endCellAndDisplayErrorsInCell (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:2:2011695)
	at R.executeCell (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:33:367697)
	at async Promise.all (index 0)
	at async R.handleExecution (c:\Users\aamunger\.vscode-insiders\extensions\ms-toolsai.jupyter-2022.6.1001811033\out\extension.node.js:33:363188)]

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
rchiodocommented, Jul 1, 2022

I just tried with last nights build. Doesn’t repro anymore for me either. New kernel picker work may have fixed this.

0reactions
rchiodocommented, Jul 12, 2022

This is the same behavior that is making the test fail: https://github.com/microsoft/vscode-jupyter/issues/10734

The root cause is that the IW is created with a kernel but then the cached viewstate for the notebook URI overrides the kernel. This is a bug in the core.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interactive window cell not executed after selecting a kernel ...
Tested in latest pre-release version of Jupyter ext. Open a Python file; Create a cell with print("Hello World"); Ensure active python ...
Read more >
Working with Jupyter code cells in the Python Interactive window
Work with Jupyter-like code cells; Run code in the Python Interactive Window; View, inspect, and filter variables using the Variables Explorer and Data ......
Read more >
New python interactive window cell does not indicate if it is still ...
Biggest problem: The collapsed cell does not indicate the status of execution anymore. Is it still running or finished? Collapsed cell. No ......
Read more >
Run and debug Jupyter notebook code cells - JetBrains
Shift+Enter : Runs the current cell and select the cell below it. When executing one cell at a time, mind code dependencies. If...
Read more >
Python interactive window (REPL) - Visual Studio
Use the interactive window (REPL) for rapid Python code development in Visual Studio.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found