CermakM / jupyter-datatables

Jupyter Notebook extension leveraging pandas DataFrames by integrating DataTables and ChartJS.
MIT License
238 stars 27 forks source link

Error on init_datatables_mode() - Comms haven't been initialized properly #30

Open psychemedia opened 4 years ago

psychemedia commented 4 years ago

Trying an install from pip and direct from the repo, I get an error trying to iniitialise the package as per the docs:

from jupyter_datatables import init_datatables_mode

init_datatables_mode()

---------------------------------------------------------------------------
CommError                                 Traceback (most recent call last)
<ipython-input-1-4bdde0100650> in <module>
      5 from jupyter_datatables import init_datatables_mode
      6 
----> 7 init_datatables_mode()

/usr/local/lib/python3.7/site-packages/jupyter_datatables/__init__.py in init_datatables_mode(options, classes)
     94     extensions = config.defaults.extensions
     95 
---> 96     require("d3", "https://d3js.org/d3.v5.min")
     97     require("d3-array", "https://d3js.org/d3-array.v2.min")
     98 

/usr/local/lib/python3.7/site-packages/jupyter_require/core.py in __call__(self, library, path, *args, **kwargs)
    111         :param path: str, path (url) to the library without .js suffix
    112         """
--> 113         self.config({library: path}, shim=kwargs.pop('shim', {}))
    114 
    115     @property

/usr/local/lib/python3.7/site-packages/jupyter_require/core.py in config(self, paths, shim)
    158         """
    159         if not require._is_initialized:
--> 160             raise CommError("Comms haven't been initialized properly.")
    161 
    162         self.__LIBS.update(paths)

CommError: Comms haven't been initialized properly.. HINT: Try reloading <F5> the window.
CermakM commented 4 years ago

Hello! Thanks for the report.

This should be fixed now by https://github.com/CermakM/jupyter-require/releases/tag/v0.5.0. Please check.

aoguedao commented 4 years ago

I have the same issue :c I have installed jupyter-datatables==0.3.9 jupyter-require==0.5.0 jupyterlab==1.2.3 python 3.7

CermakM commented 4 years ago

Could I ask any of you to try this out with python 3.6 if the issue persists please?

psychemedia commented 4 years ago

I still get the same issue on py3.7 too; no py3.6 envt to hand to try that right now...

CermakM commented 4 years ago

Please, provide browser console logs and jupyter --version output, if possible.

digitalfox commented 4 years ago

hello Same issue here. The error only happens with jupyterlab. With plain jupyter-notebook it works as expected.

CermakM commented 4 years ago

@digitalfox Yes, correct. Thanks for the confirmation.

This notebook extension is not compatible with JupyterLab, I am sorry for the inconvenience.

@psychemedia @aLoNsolml do you guys also use JupyterLab?

EDIT: There is already an existing issue #7 to add JupyterLab support.

psychemedia commented 4 years ago

My issue was in notebooks...

By the by, I note that in your README, the Binder button points to nbviewer, not a MyBinder link (I was just going to give the demo notebooks a quick test in Binder...)

aoguedao commented 4 years ago

@digitalfox Yes, correct. Thanks for the confirmation.

This notebook extension is not compatible with JupyterLab, I am sorry for the inconvenience.

@psychemedia @aLoNsolml do you guys also use JupyterLab?

EDIT: There is already an existing issue #7 to add JupyterLab support.

Yeah! I have been using jupyter lab.

CermakM commented 4 years ago

@psychemedia Good point, thank you, I'll update the binder link!

I think there might be an issue with re-opening notebooks with saved outputs. Either that or Python 3.7 I suppose :disappointed:

CermakM commented 4 years ago

The link to myBinder is fixed in: https://github.com/CermakM/jupyter-datatables/commit/59b4880f926caaecb862477f3f1c2e7bbebb4939

jvivian-atreca commented 4 years ago

Hi Marek, thank you the beautiful tool.

I am also running into this issue, but only sometimes and only with some notebooks which is particularly puzzling. I have a very large notebook (A) and a freshly created one (B). If I open B and run the init

from jupyter_datatables import init_datatables_mode
init_datatables_mode()

then it will provide me the comm error, which refreshing the page fixes. For the large notebook A, refreshing the page (which takes up to 15-30s), does not fix the issue and I encounter the comm error. Notebook A was also created before I installed jupyter-datatables, but I'm assuming that shouldn't matter.

Versions

jupyter core     : 4.6.1
jupyter-notebook : 5.7.8
qtconsole        : 4.4.3
ipython          : 7.4.0
ipykernel        : 5.1.0
jupyter client   : 5.3.4
jupyter lab      : 1.2.5
nbconvert        : 5.4.1
ipywidgets       : 7.5.1
nbformat         : 4.4.0
traitlets        : 4.3.2
jupyter-datatables                 0.3.9
jupyter-require                    0.6.1
Python 3.7.3
CermakM commented 4 years ago

@jvivian-atreca This is a super puzzling error and it's an annoying one. Feel free to investigate, I'd be really glad if somebody helped me with this one as I've been quite short on time lately.

Cheers, M

nscozzaro commented 4 years ago

I also get this error. image

phaethon commented 4 years ago

I, also, got the same issue on Centos 8, python 3.6. Workaround for this step was:

%load_ext jupyter_require
%requirejs d3 https://d3js.org/d3.v5.min

before init_datatables_mode()