modin-project / modin-spreadsheet

An interactive grid for sorting, filtering, and editing DataFrames in Jupyter notebooks
Apache License 2.0
21 stars 5 forks source link

modin_spreadsheet seems broken with ipywidgets 8.0 and python 3.10 #49

Open mvashishtha opened 1 year ago

mvashishtha commented 1 year ago

Environment

Description of Issue

I'm trying to use modin-spreadsheet. Following the README instructions, I tried jupyter nbextension enable --py --sys-prefix modin_spreadsheet and jupyter nbextension enable --py --sys-prefix widgetsnbextension. The latter worked but the first gives

Enabling notebook extension modin_spreadsheet/extension...
      - Validating: problems found:
        - require?  X modin_spreadsheet/extension

then running the notebook fails with an error starting with Failed to load model class 'ModinSpreadsheetModel' from module 'modin_spreadsheet'.

Details ``` [Open Browser Console for more detailed log - Double click to close this message] Failed to load model class 'ModinSpreadsheetModel' from module 'modin_spreadsheet' Error: No version of module modin_spreadsheet is registered at f.loadClass (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.bcbea9feb6e7c4da7530.js?v=bcbea9feb6e7c4da7530:1:74856) at f.loadModelClass (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:10729) at f._make_model (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:7517) at f.new_model (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:5137) at f.handle_comm_open (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.3e1e5adfd821b9b96340.js?v=3e1e5adfd821b9b96340:1:3894) at _handleCommOpen (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.bcbea9feb6e7c4da7530.js?v=bcbea9feb6e7c4da7530:1:73393) at b._handleCommOpen (http://localhost:8888/static/lab/jlab_core.e37d4bbc8c984154bc26.js?v=e37d4bbc8c984154bc26:2:1001251) at async b._handleMessage (http://localhost:8888/static/lab/jlab_core.e37d4bbc8c984154bc26.js?v=e37d4bbc8c984154bc26:2:1003241) ```

Reproduction Steps

  1. pp install modin
  2. pip install git+https://github.com/modin-project/modin-spreadsheet.git@49ffd89f683f54c311867d602c55443fb11bf2a5
  3. jupyter nbextension enable --py --sys-prefix widgetsnbextension
  4. jupyter nbextension enable --py --sys-prefix modin_spreadsheet
  5. jupyter notebook
  6. run jupyter cell:

    import modin.pandas as pd
    import modin_spreadsheet
    
    df = pd.DataFrame([1, 2])
    modin_spreadsheet.show_grid(df)

What steps have you taken to resolve this already?

First when I googled the error I saw something about ipywidgets so I tried to install ipywidgets 7.0. That worked, except ipywidgets 7.0 didn't work in python 3.10 because it had some from collections import that were invalid, so I had to switch to python 3.8, and then I was able to show_grid with modin_spreadsheet (I think? now I can't reproduce this in a python 3.8 environment, and I don't know what's wrong.). But I should be able to use python 3.10 and ipywidgets 7.0 and run the nbextension enable commands.

rootsmusic commented 1 year ago

See https://github.com/quantopian/qgrid/pull/331 that fixed this issue in qgrid.