Closed jacobtomlinson closed 6 years ago
Further investigation shows that if I then import and run output_notebook()
again in a new cell and then close and reopen the notebook the missing cell reappears.
I am also experiencing this. The cells are saved, but if any have bokeh output, those cells are not shown when the notebook is opened. One solution is to clear the outputs, save, and reopen. Also not ideal though.
jovyan@jupyter-tjcrone:~$ jupyter labextension list
JupyterLab v0.31.12
Known labextensions:
app dir: /opt/conda/share/jupyter/lab
@jupyter-widgets/jupyterlab-manager
@jupyter-widgets/jupyterlab-manager v0.34.0 enabled OK
@jupyterlab/hub-extension
@jupyterlab/hub-extension v0.8.1 enabled OK
@pyviz/jupyterlab_holoviews
@pyviz/jupyterlab_holoviews v0.3.3 enabled OK
jupyterlab_bokeh
jupyterlab_bokeh v0.4.0 enabled OK
Looking at the browser console while reloading the page, there's the following exception:
index.js:220 TypeError: Cannot read property 'embed' of undefined
at n.renderModel (renderer.js:71)
at t.createRenderedMimetype (widget.js:394)
at t.createOutputItem (widget.js:367)
at t._insertOutput (widget.js:335)
at new t (widget.js:168)
at new t (widget.js:432)
at t.createCodeCell (widget.js:531)
at t._createCodeCell (widget.js:399)
at t._insertCell (widget.js:377)
at widget.js:343
Specifically window.Bokeh is undefined here https://github.com/bokeh/jupyterlab_bokeh/blob/master/src/renderer.ts#L100 because the mimerenderer is executed before BokehJS has loaded and been atttached to window. Then the exception causes the cell to not be renderered :( (You can get the cells to load/plots to render by closing/reopening the notebook)
The check should assert window.Bokeh != undefined & window.Bokeh.embed.kernels !== undefined)
@jacobtomlinson @tjcrone
This issue was resolved in #34 and a new jupyterlab_bokeh=0.4.1 lab extension has been published. Please open a new issue if there are still problems.
I'm still seeing this issue with every restart of any bokeh plot using "output_notebook" with the following jupyter lab and lab extensions versions, am I missing any extensions or down reved where there is a more recent version? These are all installed from "jupyter labextension install" in the last month or less:
~> jupyter labextension list
JupyterLab v1.1.4
Known labextensions:
app dir: <...>/.pyenv/versions/anaconda3-2019.10/share/jupyter/lab
@bokeh/jupyter_bokeh v1.1.1 enabled OK
@jupyter-widgets/jupyterlab-manager v1.0.3 enabled OK
bqplot v0.5.1 enabled OK
jupyterlab-plotly v1.3.0 enabled OK
jupyterlab_bokeh v1.0.0 enabled OK
plotlywidget v1.3.0 enabled OK
qgrid v1.1.1 enabled OK
Any advice, recommendations, is appreciated. Please let me know if additional info is required.
Thanks! -chunkylover
cc @mattpap
@chunkylover7 I don't think you should have both jupyterlab_bokeh
(old) and @bokeh/jupyter_bokeh
(new) installed at the same time, you should first try and see what happens with just the most recent jupyter bokeh extension installed.
Thanks for the reply, I was using only @bokeh/jupyter_bokeh when I first noticed the issue. I found the github issue and the way I read the fix was that jupyterlab_bokeh had the patch and since I never used that extension thought it was the latest and loaded it alongside “@boken/…” this past weekend (1/5/2020) but obviously didn’t help.
I just shut down Jupyter Lab and uninstalled jupyterlab_bokeh extension so now I’m running the same config as when first discovered the issue (see below) and still have the problem (see screenshot below). Note that a cell with a large block of bokeh code is missing just below the “Loading BokehJS…” message.
JupyterLab v1.1.4 Known labextensions: app dir: /Users/.pyenv/versions/anaconda3-2019.10/share/jupyter/lab @bokeh/jupyter_bokeh v1.1.1 enabled OK @jupyter-widgets/jupyterlab-manager v1.0.3 enabled OK bqplot v0.5.1 enabled OK jupyterlab-plotly v1.3.0 enabled OK plotlywidget v1.3.0 enabled OK qgrid v1.1.1 enabled OK
[cid:image001.png@01D5C6EB.C5DDF690]
Let me know if you need any more info.
Now that I know how to work around it the problem is minor (reload output_notebook and restart the notebook) but before I found the work-around I was panicked as I had just finished a fairly complicated plot and thought Jupyter Lab had lost it forever!
@chunkylover7 The image did not seem to make it through, can you upload it directly on the GH web UI?
cc @mattpap This shows up if I reload a saved notebook in lab with 1.4.0 and the 1.1.1 extension:
Here is a screen cap showing the issue where bokeh is stuck loading bokehjs preventing cell below it from loading
Yes, just uploaded it in the issue page.
Thanks for looking at this! -mike
From: Bryan Van de Ven notifications@github.com Reply-To: bokeh/jupyter_bokeh reply@reply.github.com Date: Thursday, January 9, 2020 at 1:09 PM To: bokeh/jupyter_bokeh jupyter_bokeh@noreply.github.com Cc: chunkylover7 mikerandres@outlook.com, Mention mention@noreply.github.com Subject: Re: [bokeh/jupyter_bokeh] Cells which create bokeh plots do not get saved (#29)
@chunkylover7https://github.com/chunkylover7 The image did not seem to make it through, can you upload it directly on the GH web UI?
cc @mattpaphttps://github.com/mattpap This shows up if I reload a saved notebook in lab with 1.4.0 and the 1.1 extension:
[Screen Shot 2020-01-09 at 11 08 51 AM]https://user-images.githubusercontent.com/1078448/72097113-812cba80-32d0-11ea-9457-49737c23b1ac.png
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bokeh/jupyter_bokeh/issues/29?email_source=notifications&email_token=ACSK64WQEOWGQ5QZRDV2PRLQ45Y7NA5CNFSM4EU2LTK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIRNPMA#issuecomment-572708784, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACSK64QEOXOL3VJK7KSOHXLQ45Y7NANCNFSM4EU2LTKQ.
cc @mattpap do you have any thoughts on this?
I did some rudimentary debugging when working on widgets integration, but I don't remember right now my conclusions on this issue. I will give this another look when time permits.
Any update on this? I just spent several hours thinking I was going crazy trying to find the missing cells. Now I get the following error when reopening the notebook for each cell that should contain bokeh output:
Javascript Error: Error rendering Bokeh model: could not find #078d3e4f-4b49-4ce8-9002-53355d95ff50 HTML tag
@dbk123 I don't know what's changed on the Jupyter side to break things in reload. Please make an issue in the main repo about this, since it will have much better visibility there. And please be detailed and thorough and describe as many failure scenarios with complete steps to reproduce, etc. as possible for each. Whatever amount of detail you think is too much, double that. Debugging Jupyter issues is a nightmare and we will absolutely need everyone's help.
Hello –
Today I noticed the same behavior but in a notebook with bqplot code which I had not seen before. I used bqplot when I first started using Jupyter but then changed to Bokeh which is when I first noticed this maybe 6-8 months ago and I only ever saw it in my bokeh notebooks until today when I opened one of my older plots using bqplot.
It looked to be the same as I see with bokeh code, all cells with bqplot code were missing and only python code cells displayed. I then executed one cell block that had all of the notebook’s import statements as well as Jupyter’s autoreload extension and when it returned, closed the notebook and reopened and everything came back.
I’ll keep testing to see if it happens again with bqplot as again, this was the first time I’ve seen it in those notebooks but if it does it could hint at being a Jupyter issue.
Are you using Jupyter Lab’s autoreload extension in your affected notebook(s)?
From: Bryan Van de Ven notifications@github.com Reply-To: bokeh/jupyter_bokeh reply@reply.github.com Date: Monday, March 23, 2020 at 11:42 AM To: bokeh/jupyter_bokeh jupyter_bokeh@noreply.github.com Cc: chunkylover7 mikerandres@outlook.com, Mention mention@noreply.github.com Subject: Re: [bokeh/jupyter_bokeh] Cells which create bokeh plots do not get saved (#29)
@dbk123https://github.com/dbk123 I don't know what's changed on the Jupyter side to break things in reload. Please make an issue in the main repo about this, since it will have much better visibility there. And please be detailed and thorough and describe as many failure scenarios with complete steps to reproduce, etc. as possible for each. Debugging Jupyter issues is a nightmare and we will absolutely need everyone's help.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/bokeh/jupyter_bokeh/issues/29#issuecomment-602718594, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACSK64T7PRCHULQ2EBMSBOTRI6GO5ANCNFSM4EU2LTKQ.
I am not using the autoreload extension (at least I don't think so). Since my posting, I have been difficulty replicating this in a consistent manner so that I post in the main repo as requested by Bryan. I switched back to matplotlib for some stuff I had to get done, but am back to using bokeh now.
@chunkylover7 @dbk123 this issue should be resolved on master, we will have micro releases out in the next few weeks.
Awesome!
I am seeing this exact behavior in a new installation using Bokeh 2.0.1 and JupyterLab 2.1.0
Bringing up the java script debugger shows
Bokeh: ERROR: autoload.js configured with elementid '1001' but no matching script tag was found.
Browser is firefox v75.0
$ jupyter labextension list app dir: f:\dev\machine-learning\r-learning\nbenv\share\jupyter\lab @bokeh/jupyter_bokeh v2.0.1 enabled ok @jupyter-widgets/jupyterlab-manager v2.0.0 enabled ok JupyterLab v2.1.0 Known labextensions:
I can also confirm that running output_notebook() from anywhere within jupyter lab causes all Bokeh content to load properly again when notebooks are re-opened after that point.
I've encountered an issue where all cells which produce a bokeh plot in Jupyter Lab do not get saved.
Versions
Reproducing