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

Cannot display widget on Jupyter Notebook on a remote server #288

Closed zidonghu closed 2 years ago

zidonghu commented 2 years ago

Hello!

Describe the issue

I try to run the following code on Jupyter Notebook on a remote server, but there is no output and no error from Jupyter at all. IPython.display does not work neither. In contrast, everything works fine locally.

import pandas as pd
from ipydatagrid import DataGrid

df = pd.DataFrame(columns=[1,2,3,4], data=[[1,2,3,4], [5,6,7,8]])
DataGrid(dataframe=df)

The message from Console is as follows:

Could not instantiate widget manager-base.js: 273 Error: Could not create a model. utils.js: 119 at utils.js:119 Couldn't process kernel message Error: Script error for "ipydatagrid" main.min.js... http://requirejs.org/docs/errors.html#scripterror at makeError (require.js...) at HTMLScriptEIement.onScriptError (require.js...) Uncaught (in promise) Error: Script error for "ipydatagrid" Grid%20Test.ipynb: 1 http://requirejs.org/docs/errors.html#scripterror at makeError (require.js...) at HTMLScriptEIement.onScriptError (require.js...) Could not instantiate widget manager-base.js: 273 Error: Could not create a model. utils.js: 119 at utils.js:119 Couldn't process kernel message Error: Script error for "ipydatagrid" main.min.js... http://requirejs.org/docs/errors.html#scripterror at makeError (require.js...) at HTMLScriptEIement.onScriptError (require.js...) Uncaught (in promise) Error: Script error for "ipydatagrid" Grid%20Test.ipynb: 1 http://requirejs.org/docs/errors.html#scripterror at makeError (require.js...) at HTMLScriptEIement.onScriptError (require.js...) Uncaught (in promise) Error: Script error for "ipydatagrid" Grid%20Test.ipynb: 1 http://requirejs.org/docs/errors.html#scripterror at makeError (require.js...) at HTMLScriptEIement.onScriptError (require.js...)

Version

Package Version ipywidgets 7.6.5 ipython 7.19.0 ipydatagrid 1.1.8 jupyter 1.0.0

ibdafna commented 2 years ago

Hi 👋 @zidonghu and welcome to the ipydatagrid community!

It looks like the Jupyter setup in your remote server is quite old - jupyter 1.0.0 is a release from 2015. If everything works for you locally then it's likely the issue is with the remote environment you're running ipydatagrid in.

zidonghu commented 2 years ago

Hi @ibdafna and happy New Year!

Thanks a lot for the suggestion. I attempt to update my jupyter server and everything works fine now.

All the best in 2022!