Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load @finos/perspective-jupyterlab:~0.10.0 #1502

Closed
kimmolinna opened this issue Aug 3, 2021 · 9 comments
Closed

Unable to load @finos/perspective-jupyterlab:~0.10.0 #1502

kimmolinna opened this issue Aug 3, 2021 · 9 comments

Comments

@kimmolinna
Copy link

PercpectiveWidget is working nicely via localhost/lab, but when I try to use it inside Visual Studio Code Insiders I will get the following error message:

Widgets require us to download supporting files from a 3rd party website. (Error loading @finos/perspective-jupyterlab:~0.10.0).

I used to the following example to notice a problem

import pandas as pd
import numpy as np
from perspective import Table, PerspectiveWidget
arrays = [np.array(['bar', 'bar', 'bar', 'bar', 'baz', 'baz', 'baz', 'baz', 'foo', 'foo', 'foo', 'foo', 'qux', 'qux', 'qux', 'qux']),
          np.array(['one', 'one', 'two', 'two', 'one', 'one', 'two', 'two', 'one', 'one', 'two', 'two', 'one', 'one', 'two', 'two']),
          np.array(['X', 'Y', 'X', 'Y', 'X', 'Y', 'X', 'Y', 'X', 'Y', 'X', 'Y', 'X', 'Y', 'X', 'Y'])]
tuples = list(zip(*arrays))
index = pd.MultiIndex.from_tuples(tuples, names=['first', 'second', 'third',])

df_col = pd.DataFrame(np.random.randn(3, 16), index=['A', 'B', 'C'], columns=index)
PerspectiveWidget(df_col)

I'm using JupyterLab 3.1.1 with Jupyter Server 1.10.1 and Visual Studio Code - Insiders is 1.59.0-insider on Windows 10 Enterprise 1908 and

And jupyter labextension list looks like

JupyterLab v3.1.1
c:\users\ay29782\appdata\local\programs\python\python39\share\jupyter\labextensions
        @jupyter-widgets/jupyterlab-manager v3.0.0 enabled ok (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
   app dir: C:\Users\ay29782\AppData\Local\Programs\Python\Python39\share\jupyter\lab
        @finos/perspective-jupyterlab v0.10.0 enabled ok
        jupyterlab_widgets v0.3.1 enabled ok
@timkpaine
Copy link
Member

VS Code does not support labextensions, it would be best to reach out to them to ask about their plans for supporting them out of the box. More thoughts in this ticket #1251

@kimmolinna
Copy link
Author

kimmolinna commented Aug 4, 2021

@timkpaine I thought VS Code Insiders does support labextensions. At least Matplotlib is working nicely as you already knew because there was a picture about it in ticket #1251.

@timkpaine
Copy link
Member

@kimmolinna that is using a notebook extension not a lab extension.

@kimmolinna
Copy link
Author

kimmolinna commented Aug 4, 2021

@timkpaine Is it also same for itkwidgets and bqplot (installed via Jupyterlab extension tab)? I have installed itkwidgets using jupyter labextension install jupyterlab-datawidgets itkwidgets. I installed matplot also from Jupyterlab extension tab and thought that it would be labextension. How can I know which one is a notebook extension and which one is a lab extension if an extension which is installed via jupyter labextension install [extension] is not the lab extension?

@timkpaine
Copy link
Member

If you check the web pack file you can find bundling specific for lab and for notebook https://github.com/InsightSoftwareConsortium/itkwidgets/blob/a05a15afe9f57dee5be7e21e13a96bd61959ae99/js/webpack.config.js#L50

@kimmolinna
Copy link
Author

@timkpaine Is it correct that a character in a name of module version is ~ instead of ^?

Error 2021-08-04 15:12:08: Widget load failure Widgets require us to download supporting files from a 3rd party website. (Error loading @finos/perspective-jupyterlab:~0.10.0). {
  className: 'PerspectiveModel',
  moduleName: '@finos/perspective-jupyterlab',
  moduleVersion: '~0.10.0',
  cdnsUsed: false,
  isOnline: true,
  timedout: false,
  error: {}

@timkpaine
Copy link
Member

Yes

@kimmolinna
Copy link
Author

@timkpaine So basically I have understood the whole think wrong. JupyterLab is an interface which is working in browser and uses notebooks as a storage. And Visual Studio Code can use the same notebooks too. My apologies.

@timkpaine
Copy link
Member

timkpaine commented Aug 4, 2021

JupyterLab is the newer interface, Jupyter Notebook is the older interface. VS Code has some degree of compatibility with the old interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants