manzt / quak

a scalable data profiler
https://manzt.github.io/quak/
MIT License
240 stars 11 forks source link

Failure to load model in legacy Jupyter Notebook #29

Closed cpsievert closed 2 months ago

cpsievert commented 3 months ago

Cool package! I was eager to see how it works with Shiny via shinywidgets, but it seems something in my Python environment is off. I get the following JS error when trying to render the Widget in Jupyter:

Screenshot 2024-07-30 at 4 20 15 PM

And here is more info about that error:

Screenshot 2024-07-30 at 4 17 50 PM

Happy to offer any more information you think might be relevant (or even pair on it, if you'd like)

manzt commented 3 months ago

This error usually comes up with widgets if you %pip or !pip install anywidget for the first time in a running jupyter environment. Please try shutting down the Jupyter server and restarting (not just restarting the kernel).

The anywidget python package removes this issue for all other anywidgets, but it's still a limitation of Jupyter Widgets that traditional widgets aren't installed from the kernel.

manzt commented 3 months ago

Hard to know for sure if this is the issue (expanding the Error: Script error for "anywidget" might provide more context). If restarting the server doesn't work, a minimal reproducible example for 1.) creating your Python env and 2.) starting Jupyter would be necessary to debug on my end.

cpsievert commented 3 months ago

I still get the same error after shutting down the server -- maybe it's because I have an old version of the notebook?

$ jupyter notebook --version
6.5.2

Good news though -- it does work with JupyterLab:

$ jupyter lab --version
3.5.3

And also the Python kernel that I'm using is 3.12.

manzt commented 3 months ago

Oh interesting, thanks for sharing. I'll have a look.

manzt commented 3 months ago

Can you share how you made the Python environment ~and the version of Python~? I'm not able to reproduce.

image

❯ jupyter --version
IPython          : 8.18.1
ipykernel        : 6.29.5
ipywidgets       : 8.1.3
jupyter_client   : 8.6.2
jupyter_core     : 5.7.2
jupyter_server   : 2.14.2
jupyterlab       : not installed
nbclient         : 0.10.0
nbconvert        : 7.16.4
nbformat         : 5.10.4
++ notebook         : 6.5.2
qtconsole        : not installed
traitlets        : 5.9.0
manzt commented 2 months ago

Closing as I haven't been able to reproduce. Please let me know if after creating a fresh environment you still have troubles!