itkwidgets icon indicating copy to clipboard operation
itkwidgets copied to clipboard

Widget not showing on VSCode with Remote SSH

Open tjahn opened this issue 3 years ago • 13 comments

Hello,

I am on MacOS and using itkwidgets 0.32.0 on VSCode 1.55.2 to work on a remote Linux Server using the Remote-SSH Extension 0.65.1. However, the itkwidget is not showing up in the interactive python console. I set the python.loggin.level to debug, but didn't see any meaningful errors or warnings in the Jupyter and Python output console.

This here is my test script:

import numpy as np
from itkwidgets import view
image = np.random.rand(100,100)
view(image)

When running the same script locally, without the Remote Extension, the widget is working nicely. It even works, when I connecting to an existing Jupyter server running on said remote Linux Server.

It might not be correlated, but when I tried adding "jupyter.widgetScriptSources": ["jsdelivr.com", "unpkg.com"], to the remote ssh settings I got this VSCode warning when running the test script:

Unable to load a compatible version of the widget 'itkwidgets'. Expected behavior may be affected.

tjahn avatar Apr 14 '21 08:04 tjahn

Hi @tjahn,

Thanks for the report and detailed information!

To confirm, when using in VSCode, the widget is used as a JupyterLab widget versus a Jupyter Notebook widget?

Thanks, Matt

thewtex avatar May 14 '21 15:05 thewtex

seeing a similar thing here. remoting into linux, using itkwidgets.view shows nothing (but no error either):

Untitled

FWIW: If I click the ... next to where the widget, I have the option to pick a renderer (one shows the text repr, the other shows the empty space)

Untitled

@thewtex, lemme know if I can help troubleshoot! thanks :)

tlambert03 avatar Apr 23 '22 14:04 tlambert03

I reproduced this locally.

@oeway with the recent itkwidgets ImJoy upgrade and with the ImJoy VSCode extension install, there still is no output. How could we get ImJoy window in the VSCode Jupyter output?

thewtex avatar May 21 '22 23:05 thewtex

Hmm, I think it's a bit tricky to get it work there, it's not a normal Jupyter environment as I understand, to get it work we need a way to do bidirectional messaging between the editor and the kernel, plus a way to show the iframe. In the normal Jupyter we used Comm messages, I am not sure if that is available and what need to be adjusted.

I will need to check it out.

oeway avatar May 22 '22 13:05 oeway

seeing a similar thing here. remoting into linux, using itkwidgets.view shows nothing (but no error either):

Untitled

FWIW: If I click the ... next to where the widget, I have the option to pick a renderer (one shows the text repr, the other shows the empty space)

Untitled

@thewtex, lemme know if I can help troubleshoot! thanks :)

same issue

linye-boli avatar Jul 19 '22 07:07 linye-boli

I have the same issue, though I am not sure it is only related to VSCode: when I start the jupyter notebook server directly on the remote machine, and connect to it using Firefox (with Google Chrome I am getting a similar error), I am getting the following error message instead of the itkwidget box:

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'ViewerModel' from module 'itkwidgets'
makeError@http://localhost:8888/static/components/requirejs/require.js?v=f0cc8bbb2fcef87fc194fecbb632fcfa:168:17
onScriptError@http://localhost:8888/static/components/requirejs/require.js?v=f0cc8bbb2fcef87fc194fecbb632fcfa:1738:36

Sometimes it even crashes the kernel. I looked into the Browser Console, but the error message is the same. Any idea? Thanks in advance!

mgenet avatar Nov 01 '22 13:11 mgenet

any updates on this ? same problem.

NessimBenA avatar Dec 10 '22 21:12 NessimBenA

I have the same issue, though I am not sure it is only related to VSCode: when I start the jupyter notebook server directly on the remote machine, and connect to it using Firefox (with Google Chrome I am getting a similar error), I am getting the following error message instead of the itkwidget box:

[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'ViewerModel' from module 'itkwidgets'
makeError@http://localhost:8888/static/components/requirejs/require.js?v=f0cc8bbb2fcef87fc194fecbb632fcfa:168:17
onScriptError@http://localhost:8888/static/components/requirejs/require.js?v=f0cc8bbb2fcef87fc194fecbb632fcfa:1738:36

Sometimes it even crashes the kernel. I looked into the Browser Console, but the error message is the same. Any idea? Thanks in advance!

I could use itkwidgets.view on browser but now I can't. The same error. Is there any update?

dddraxxx avatar Dec 13 '22 09:12 dddraxxx

Same with ipywidgets

nkise-nlab avatar Jan 04 '23 20:01 nkise-nlab

Looking into the details, VSCode's Notebook extension support is extremely limiting. For a first pass, that will enable all itkwidgets functionality and work with different VSCode deployments (local, remote, GitPod, GitHub Codespaces, etc.), we could leverage #589 along with an extension that previews a python-driver server content.

thewtex avatar Jan 07 '23 23:01 thewtex

Is it working on WSL or remote-ssh? Widgets not showing on vscode image

My version is 1.0a35

@thewtex

ubless607 avatar Sep 07 '23 05:09 ubless607

@ubless607 the experimental CLI support works in VSCode's terminal and remote ssh WSL.

thewtex avatar Dec 11 '23 15:12 thewtex

any updates on this ? same problem on remote with k8s

jxfruit avatar Apr 01 '24 07:04 jxfruit