jupyter-widgets / ipydatagrid

Fast Datagrid widget for the Jupyter Notebook and JupyterLab
BSD 3-Clause "New" or "Revised" License
580 stars 51 forks source link

DataGrid doesn't display table, only text #526

Closed u3Izx9ql7vW4 closed 4 months ago

u3Izx9ql7vW4 commented 4 months ago

Describe the bug Calling DataGrid() in JupyterLab cell prints

DataGrid(auto_fit_params={'area': 'all', 'padding': 30, 'numCols': None}, corner_renderer=None, default_render…

but doesn't display any table

To Reproduce Steps to reproduce the behavior: Run pip install ipydatagrid Create a pandas dataframe in cell and run cell

from ipydatagrid import DataGrid

df = pd.DataFrame(...)
DataGrid(df)

Expected behavior Should display table

Screenshots

Capture d’écran 2024-07-09 à 16 27 39

Environment (please complete the following information):

Additional context Installed with pip install ipydatagrid

xbrianh commented 2 weeks ago

I see the same issue with ipydatagrid 1.3.2

xbrianh commented 2 weeks ago

This was resolved for me with:

pip install jupyter_contrib_nbextensions

and restarting my notebook server.

martinRenou commented 2 weeks ago

Note for the future reader that installing jupyter_nbcontrib_nbextensions will have no impact on installation issues for ipydatagrid. I would actually recommend not doing this as this is probably outdated now that jupyterlab is the official frontend for jupyter, and latest jupyter notebook uses lab extensions, not nbextensions.

Restarting the Notebook server is important though. Otherwise the ipydatagrid extension is not loaded by the server.