Giter Club home page Giter Club logo

Comments (4)

kylebarron avatar kylebarron commented on September 22, 2024 1

I just installed jupyterlab directly in my lonboard env, launched JLab from that env and bingo.

FWIW this is what I usually do personally.

For other cases, all you need is to install anywidget in the JupyterLab environment, so that anywidget's JS code exists in JupyterLab when you start the page. Then you can install lonboard separately inside a user environment. You do have to ensure that the anywidget version on the backend (in JupyterLab) and anywidget in the user environment is semver compatible.

from lonboard.

kylebarron avatar kylebarron commented on September 22, 2024

Unsurprisingly, there's been discussion on this before. See especially manzt/anywidget#385 (comment).

Note that the architecture of anywidget is that anywidget serves as a bridge between "fully bundled" widgets that need to be installed in full on the server and "dynamically imported" widgets. Anywidget itself loads the JS from the anywidget-based widget. Therefore only a compatible version of anywidget needs to be installed on the server. In our case, lonboard does not need to be installed on the server, only anywidget.

There are further questions about ensuring compatible versions of anywidget between frontend and server, but that's a more general question outside of lonboard's scope.

Solara also does some nice checks around this: manzt/anywidget#385 (comment)

from lonboard.

paddymul avatar paddymul commented on September 22, 2024

FWIW In my own IPYwidget library buckaroo, I addressed some of this.
Users frequently pip installed the library without restarting the server. This causes a JS error with no python error. I added a check on the MTime of the python library, and the start time of the server.

https://github.com/paddymul/buckaroo/blob/main/buckaroo/widget_utils.py#L37-L55

I'm interested to hear about other approaches around this problem. It's a really poor experience for an initial user install. Maybe you could source the JS from unpackage when the user would encounter the problem.

from lonboard.

ymoisan avatar ymoisan commented on September 22, 2024

discussion on this before. See especially manzt/anywidget#385 (comment).

says "... a virtual environment (Python venv, Conda environment or what have you) where package jupyterlab has been deployed — one deploys their widget package in the same environment as where Jupyter Lab lives" (bold mine).

When I was running for example your NYC building notebook from a Jupyter Lab instance launched from my jupyterlab conda env -- to which I had made my lonboard conda env visible as a kernel with the usual ipykernel dance -- I was having rendering issues e.g.

[1] m
Map(layers=[PolygonLayer(extruded=True, get_elevation=<pyarrow.lib.FloatArray object at 0x0000028B03972680>
[
…

And similar errors for ScatterPlot layers and viz([])

In order to fix this, I just installed jupyterlab directly in my lonboard env, launched JLab from that env and bingo.

Unless there's a "JS dance" to expose the JS of conda envs in kernels exported to jupyterlab, I think that means we need to duplicate jupyterlab installs for those conda envs where there is JS.

lonboard v. '0.9.3' in Jupyter Lab 4.2.1

from lonboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.