-
-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Javascript Errors when setting Extension in Jupyter Notebook #5699
Comments
I've done it repeatedly these past few days on a fresh notebook (w/extensions disabled). I will get one of three behaviours:
Because of the intermittent behaviour and the frequency of "unexpected identifier xxx" messages, it's like the UI is sometimes receiving partial/truncated data/message?
|
Did you try it in a clean environment? And can you paste your |
Yes, clean environment meaning new notebook w/just two cells as illustrated above. pip list:
|
Can you create a new environment with only a notebook and holoviews (or at least without torch). |
Getting error below in new env (list below). If I run the cell again I may get another random error eg. Unexpected identifier 'SelectEditorView', Unexpected identifier 'a' (see below), etc. but eventually the extension loads correctly. A bit of searching finds refs to First error.
Env package list:
|
It is generally not advised to mix PyPi and conda-forge (though, I don't think this is the problem). Can you give me the output of You could try running dev releases of panel + holoviews by running You can also see if there is some weird setting in |
Voila. Tnx for the assist. |
This error. Also happened after renaming: This env: |
Thank you. I could recreate the problem. It seems to be coming from @philippjfr, should I move this to Panel? |
In case it helps: if this error crops up you have to reset the kernel.
|
Can you try I'm also getting this error in the jupyter logs: E 11:04:14.585 NotebookApp] Uncaught exception, closing connection.
Traceback (most recent call last):
File "/Users/shh/miniconda3/envs/tmp55/lib/python3.10/site-packages/tornado/iostream.py", line 695, in _handle_events
self._handle_write()
File "/Users/shh/miniconda3/envs/tmp55/lib/python3.10/site-packages/tornado/iostream.py", line 965, in _handle_write
self._write_buffer.advance(num_bytes)
File "/Users/shh/miniconda3/envs/tmp55/lib/python3.10/site-packages/tornado/iostream.py", line 182, in advance
assert 0 < size <= self._size
AssertionError
Exception in callback None()
handle: <Handle cancelled>
Traceback (most recent call last):
File "/Users/shh/miniconda3/envs/tmp55/lib/python3.10/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "/Users/shh/miniconda3/envs/tmp55/lib/python3.10/site-packages/tornado/platform/asyncio.py", line 192, in _handle_events
handler_func(fileobj, events)
File "/Users/shh/miniconda3/envs/tmp55/lib/python3.10/site-packages/tornado/iostream.py", line 695, in _handle_events
self._handle_write()
File "/Users/shh/miniconda3/envs/tmp55/lib/python3.10/site-packages/tornado/iostream.py", line 965, in _handle_write
self._write_buffer.advance(num_bytes)
File "/Users/shh/miniconda3/envs/tmp55/lib/python3.10/site-packages/tornado/iostream.py", line 182, in advance
assert 0 < size <= self._size
AssertionError |
Let me preface by saying it seems to be more stable (subjectively) but ... I tried your suggestion in a 2 cell notebook: first cell did imports, second executed If it ran successfully sometimes I got in the following in the js console:
If I repeatedly run the second cell with the
If I repeatedly run the second cell w/o the
|
I've also run into this issue and have found that pinning tornado to 6.1 seems to fix it. Creating the following environment without pinning tornado almost always gives the javascript error and also the tornado AssertionError when I restart the kernel. It also does not always render the plots even though the extensions seem to load if you run the cell again after you get the javascript syntax error.
SyntaxError and AssertionError on kernel restart using above env:AssertionError exception in tornado when kernel is restarted Update: Adding the correct AssertionError
Pinning the tornado version seems to fix it:
The holoviews example is just running part of the `Tap` example (see below):
|
Thank you, @sandhujasmine. Looking at a linked issue in the thread you linked jupyter/notebook#6721 (comment), it seems to be related to changes made in |
@hoxbro - I manually tested this and it seems to work with newer tornado but older jupyter_client as you suggested.
|
ALL software version info
MacOS: Ventura 13.3.1
holoviews: 1.15.4
bokeh: 2.4.3
matplotlib: 3.7.1
matplotlib-inline: 0.1.6
python: 3.10.10
jupyter notebook server: 6.5.4
Description of expected behavior and the observed behavior
After several successful plots, rendering stops completely in a Jupyter Notebook. The behaviour seems intermittent. The following simple experiment isolates the general behaviour.
In a completely new jupyter notebook, I execute three cells in order as follows:
The code is doing nothing but an import and setting extensions. The javascript console shows:
Important: If I go back and run the cells again ... no errors.
The challenge is the behaviour shows up intermittently in that graphical output will be fine for several cells, then stop working. Clearing the fault and getting expected behaviour again means forcing re-import of holoviews and/or resetting the extension until the JS error no longer appears and/or restarting the kernel.
I'm not sure if this is a Holoviews challenge or a Jupyter challenge b/c when running in my working notebook I sometimes get this JS console error:
The text was updated successfully, but these errors were encountered: