Closed bergkvist closed 4 years ago
It's most likely a deck.gl versioning problem. There's no sandbox in the browser between widgets, and pydeck and keplergl aren't released together, so there's no easy way to be sure that the underlying JS part of the widget is using the same deck.gl version. Because there's no sandbox, the deck version from one will overwrite the deck provided with the other.
I think the necessary workaround is to use separate browser tabs or at least reload the page when switching between pydeck and keplergl.
Reloading the browser/using different tabs doesn't have any effect. To switch between keplergl and pydeck I actually need to uninstall/reinstall/rebuild the widgets. And this takes a long time (~10-15 minutes on my laptop).
An alternative would be to create 2 separate docker images and run both of them side-by-side (that way I don't need to wait 10-15 min every time I want to switch).
Since jupyterlab extensions are built using webpack, perhaps something like this could be used to avoid deck.gl version conflicts?
// package.json
"dependencies": {
"keplergl-deck.gl": "npm:deck.gl@8.2.5",
"pydeck-deck.gl": "npm:deck.gl@8.2.7"
}
This syntax is available since npm v6.9.0 (Mar 6, 2019)
While I agree that deck.gl versions could be a source of problems, the error messages you are receiving seem more related to the jupyter widget API (jupyterWidgetRegistry, get_model, renderModel).
It could of course be some deck issue that prevents initialization but normally I would expect jupyter to initialize first.
@ajduberstein
FYI I tried this out and I see in the browser console:
Error: deck.gl - multiple versions detected: 8.2.7 vs 8.2.5
at Object.push.WQvm (vendors~main.bb9e8da21be7567696e5.js:391674)
at r (vendors~main.bb9e8da21be7567696e5.js:391657)
at Object.push.WQvm (vendors~main.bb9e8da21be7567696e5.js:391674)
at r (vendors~main.bb9e8da21be7567696e5.js:391657)
at Module.push.WQvm (vendors~main.bb9e8da21be7567696e5.js:391657)
at r (vendors~main.bb9e8da21be7567696e5.js:391657)
at Object.<anonymous> (vendors~main.bb9e8da21be7567696e5.js:391674)
at Object.push.WQvm (vendors~main.bb9e8da21be7567696e5.js:391674)
at r (vendors~main.bb9e8da21be7567696e5.js:391657)
at Object.push.WQvm (vendors~main.bb9e8da21be7567696e5.js:391657)
At first glance it looks like that's the cause of the widget model not found
errors.
This might have been caused by the JupyterLab version (v1.2.5). I'm not 100% sure if this is the reason - but I suddenly got both widgets working at the same time in JupyterLab v2.2.5 now.
In case you are interested, the docker image where I got it working is available at bergkvist/kognilab:v1.1.4 (Docker Hub):
I'm also not getting any errors regarding conflicting deck.gl-versions in this Docker image.
Thanks for filing the issue, @bergkvist–could we get the output of jupyter labextension list
for the broken and working environments? This will help us fix this same problem for other users in the future.
@ajduberstein
Broken environment (jupyter labextension list
):
JupyterLab v1.2.5
Known labextensions:
app dir: /usr/share/jupyter/lab
@deck.gl/jupyter-widget v8.2.7 enabled OK
@jupyter-widgets/jupyterlab-manager v1.1.0 enabled OK
jupyter-matplotlib v0.5.0 enabled OK
jupyterlab-plotly v4.8.0 enabled OK
keplergl-jupyter v0.2.1 enabled OK
plotlywidget v4.8.0 enabled OK
Working environment (jupyter labextension list
):
JupyterLab v2.2.5
Known labextensions:
app dir: /opt/conda/share/jupyter/lab
@bokeh/jupyter_bokeh v2.0.3 enabled OK
@deck.gl/jupyter-widget v8.2.7 enabled OK
@jupyter-widgets/jupyterlab-manager v2.0.0 enabled OK
@krassowski/jupyterlab-lsp v1.1.2 enabled OK
dask-labextension v3.0.0 enabled OK
jupyter-matplotlib v0.7.3 enabled OK
jupyterlab-plotly v4.9.0 enabled OK
keplergl-jupyter v0.2.1 enabled OK
plotlywidget v4.9.0 enabled OK
Notice @jupyter-widgets/jupyterlab-manager
, which has different major versions (and is a dependency of keplergl-jupyter
and @deck.gl/jupyter-widget
).
I can't seem to get both
keplergl
andpydeck
widgets to work in JupyterLab at the same timekeplergl alone works fine
pydeck alone works fine
keplergl and pydeck at the same time does not work
Reversing installation order reverses the problem: