Skip to content

Local nbextensions can't be found for kernel launched from local kernelspecΒ #16823

@egormkn

Description

@egormkn

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

Hello!
I found a bug in vscode-jupyter extension: it does not load local nbextensions if the kernel was launched from a local kernelspec. In this case I get "No nbextensions folder found for kernel" in Jupyter log and widgets do not work if CDN access was not granted, even though I have an nbextensions directory with needed javascript in <venv>/share/jupyter. If I launch a kernel from venv interpreter, everything works as expected.

It seems that happens because NbExtensionsPathProvider does not process the startUsingLocalKernelSpec kind.

I encountered this problem while trying to fix the pythreejs bug with a patch, so you should be able to reproduce the issue with something like pip install git+https://github.com/jupyter-widgets/pythreejs.git@b41067fa9347c55d30821f3e3a85c01aab1726e9 and then executing:

import pythreejs
pythreejs.Group(children=[pythreejs.ArrowHelper(dir=[0, 0, 1]), pythreejs.ArrowHelper(dir=[0, 1, 0])])

(this fails until the patched version of pythreejs is uploaded to CDN)

There was also a relevant discussion about local development of ipywidgets, but I think the author there used an interpreter-based kernel, not a kernelspec-based.

VS Code Version

1.102.1

Jupyter Extension Version

2025.6.0

Jupyter logs

Visual Studio Code (1.102.1, undefined, desktop)
Jupyter Extension Version: 2025.6.0.
Python Extension Version: 2025.10.0.
Python Environment Extension not installed.
Pylance Extension Version: 2025.6.2.
Platform: linux (x64).
Home = /home/<username>
Temp Storage folder ~/.config/Code/User/globalStorage/ms-toolsai.jupyter/version-2025.6.0
Workspace folder ~/workspace
09:50:04.868 [debug] Start refreshing Kernel Picker (1753080604868)
09:50:05.000 [debug] Get Custom Env Variables, Class name = Hm, completed in 132ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
09:50:05.001 [warn] No interpreter with path ~/venv/bin/python3 found in Python API, will convert Uri path to string as Id ~/venv/bin/python3
09:50:05.044 [debug] Jupyter Paths /kernels: ~/venv/share/jupyter/kernels
09:50:05.044 [debug] Kernel Spec Root Paths, ~/venv/share/jupyter/kernels, /usr/share/jupyter/kernels, /usr/local/share/jupyter/kernels, ~/.local/share/jupyter/kernels
09:50:05.764 [trace] Conda file is conda
09:50:05.778 [trace] Python API env change detected, add => '~/.pyenv/versions/3.12.9/bin/python'
09:50:05.779 [trace] Search for KernelSpecs in Interpreter ~/.pyenv/versions/3.12.9/bin/python
09:50:05.801 [trace] Python API env change detected, add => '/bin/python'
09:50:05.801 [trace] Search for KernelSpecs in Interpreter /bin/python
09:50:05.811 [trace] Python API env change detected, add => '/usr/bin/python'
09:50:05.811 [trace] Search for KernelSpecs in Interpreter /usr/bin/python
09:50:05.817 [trace] Python API env change detected, add => '~/venv/bin/python'
09:50:05.817 [trace] Search for KernelSpecs in Interpreter ~/venv/bin/python
09:50:05.847 [debug] KernelProvider switched kernel to id = .custom.~/venv/bin/python3.~/venv/python.-m#jupytercloud.custom_kernel.lib.kernel
09:50:05.848 [debug] start the kernel, options.disableUI=true for ~/workspace/Untitled-2.ipynb
09:50:05.869 [trace] Registering commtarget jupyter.widget
09:50:05.870 [debug] Controller selection change completed
09:50:05.878 [debug] End refreshing Kernel Picker (1753080604868)
09:50:05.879 [info] Starting Kernel (Python Path: ~/venv/bin/python, Venv, 3.12.11) for '~/workspace/Untitled-2.ipynb' (disableUI=true)
09:50:05.879 [trace] Creating raw notebook for resource '~/workspace/Untitled-2.ipynb'
09:50:05.904 [debug] Get Custom Env Variables, Class name = Hm, completed in 1ms, has a truthy return value, Arg 1: "~/workspace", Arg 2: "RunPythonCode"
09:50:05.904 [debug] Get Custom Env Variables, Class name = Hm, completed in 1ms, has a truthy return value, Arg 1: "~/workspace/Untitled-2.ipynb", Arg 2: "RunPythonCode"
09:50:05.906 [debug] Launching kernel .custom.~/venv/bin/python3.~/venv/python.-m#jupytercloud.custom_kernel.lib.kernel for ~/workspace/Untitled-2.ipynb in ~/workspace with ports 9001, 9000, 9004, 9002, 9003
09:50:05.906 [info] Launching Raw Kernel Custom Python 3 # ~/venv/bin/python3
09:50:05.906 [debug] Create ProcessService, Class name = qm (started execution), Arg 1: "~/workspace/Untitled-2.ipynb", Arg 2: {"a":false,"b":{"A":3,"z":{"i":-1,"end":0},"w":[{"id":870},{"id":871},null,{"id":874}]}}
09:50:05.909 [debug] Get Custom Env Variables, Class name = Hm, completed in 3ms, has a truthy return value, Arg 1: "~/workspace/Untitled-2.ipynb", Arg 2: "RunNonPythonCode", Arg 3: {"a":false,"b":{"A":3,"z":{"i":-1,"end":0},"w":[{"id":870},{"id":871},null,{"id":874}]}}
09:50:05.909 [debug] Create ProcessService, Class name = qm, completed in 3ms, has a truthy return value, Arg 1: "~/workspace/Untitled-2.ipynb", Arg 2: {"a":false,"b":{"A":3,"z":{"i":-1,"end":0},"w":[{"id":870},{"id":871},null,{"id":874}]}}
09:50:06.309 [debug] Got env vars from Python Ext in 405ms for ~/venv/bin/python, with env var count 89.
09:50:06.309 [trace] Prepend PATH with python bin for ~/venv/bin/python
09:50:06.309 [debug] Getting activated env variables, Class name = Fd, completed in 406ms, has a truthy return value, Arg 1: "~/workspace", Arg 2: "~/venv/bin/python", Arg 3: undefined
09:50:06.315 [info] Process Execution: ~/venv/bin/python -m pip list
09:50:06.322 [debug] Got env vars from Python Ext in 418ms for ~/venv/bin/python, with env var count 89.
09:50:06.322 [trace] Prepend PATH with python bin for ~/venv/bin/python
09:50:06.322 [debug] Getting activated env variables, Class name = Fd, completed in 419ms, has a truthy return value, Arg 1: "~/workspace/Untitled-2.ipynb", Arg 2: "~/venv/bin/python", Arg 3: undefined
09:50:06.329 [info] Process Execution: ~/venv/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
09:50:06.336 [info] Process Execution: ~/venv/bin/python3 -m jupytercloud.custom_kernel.lib.kernel -f /run/user/1001/jupyter/runtime/kernel-v359184539e08736779641732b1abea7bcdf19207a.json
    > cwd: ~/workspace
09:50:06.336 [debug] Kernel process 392076.
09:50:07.195 [trace] ipykernel version & path 6.29.5, ~/python/ipykernel/py3/ipykernel/__init__.py for ~/venv/bin/python

09:50:09.313 [debug] KernelProcess error 392076: [I 2025-07-21 09:50:09.312 CustomKernelApp kernelapp:324] Starting the kernel at pid: 392076

09:50:09.320 [debug] KernelProcess error 392076: [I 2025-07-21 09:50:09.320 CustomKernelApp kernelapp:445] To connect another client to this kernel, use:
[I 2025-07-21 09:50:09.320 CustomKernelApp kernelapp:445]     --existing /run/user/1001/jupyter/runtime/kernel-v359184539e08736779641732b1abea7bcdf19207a.json

09:50:09.321 [debug] Kernel output 392076: To connect another client to this kernel, use:
--existing /run/user/1001/jupyter/runtime/kernel-v359184539e08736779641732b1abea7bcdf19207a.json
09:50:09.395 [debug] Waiting for Raw Session to be ready in postStartRawSession
09:50:09.395 [debug] Waiting for Raw session to be ready, status: connected
09:50:09.396 [trace] Raw session connected
09:50:09.397 [debug] Waited for Raw session to be ready & got status: connected
09:50:09.397 [debug] Successfully waited for Raw Session to be ready in postStartRawSession
09:50:09.397 [debug] Kernel status is 'unknown' before requesting kernel info and after ready
09:50:09.397 [debug] Sending request for kernelInfo
09:50:09.399 [debug] KernelProcess error 392076: [I 2025-07-21 09:50:09.356 CustomKernelApp shellapp:325] Loading IPython extension: storemagic

09:50:09.402 [trace] Got response for requestKernelInfo
09:50:09.402 [debug] Successfully completed postStartRawSession after 1 attempt(s) in 5ms
09:50:09.405 [trace] Executing silently Code (idle) = import sys as _VSCODE_sys\nprint(_VSCODE_sys.executable); del _VSCODE_sys
09:50:09.411 [trace] Executing silently Code (completed) = import sys as _VSCODE_sys\nprint(_VSCODE_sys.executable); del _VSCODE_sys with 1 output(s)
09:50:09.412 [trace] Started running kernel initialization for ~/workspace/Untitled-2.ipynb
09:50:09.412 [trace] Executing silently Code (idle) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy
09:50:09.510 [trace] Executing silently Code (completed) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy with 1 output(s)
09:50:09.511 [trace] Determined IPyWidgets Version as 8
09:50:09.511 [trace] Version of IPyWidgets 8 determined after 3.642s
09:50:09.511 [trace] Executing silently Code (idle) = def __VSCODE_inject_module():\ndef __VSCODE_call_function(function, callback, data=None):
09:50:09.525 [trace] Executing silently Code (completed) = def __VSCODE_inject_module():\ndef __VSCODE_call_function(function, callback, data=None): with 0 output(s)
09:50:09.525 [debug] Requesting Kernel info
09:50:09.526 [trace] Got Kernel info
09:50:09.526 [trace] End running kernel initialization, now waiting for idle
09:50:09.526 [trace] Waiting for idle on (kernel): 5fb33bae-1b74-45ad-98d1-a5cf6f5cae05 -> idle
09:50:09.526 [trace] Finished waiting for idle on (kernel): 5fb33bae-1b74-45ad-98d1-a5cf6f5cae05 -> idle
09:50:09.527 [trace] End running kernel initialization, session is idle
09:50:09.527 [trace] Registering Kernel Completion Provider from kernel Custom Python 3 (Python 3.12.11) for language python
09:50:09.528 [trace] IPyWidgetScriptSource.initialize
09:50:09.529 [info] Kernel successfully started
09:50:09.529 [warn] No nbextensions folder found for kernel .custom.~/venv/bin/python3.~/venv/python.-m#jupytercloud.custom_kernel.lib.kernel
09:50:10.032 [trace] Web view is ready to receive widget messages
09:50:10.043 [trace] Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
09:50:10.043 [trace] Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
09:50:10.051 [trace] Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
09:50:10.051 [trace] Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
09:50:10.202 [error] Widget Error: Failed to access CDN https://unpkg.com/ after 0 attempt(s), TypeError: Failed to fetch

Coding Language and Runtime Version

Python v3.12.9

Language Extension Version (if applicable)

2025.10.0

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugipywidgetsRendering, loading, saving, anything to do with IPyWidgetsverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions