-
Notifications
You must be signed in to change notification settings - Fork 569
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
nbconvert timing out on relatively simply notebook #1656
Comments
You need to increase |
I thought the timeout is disabled by default? See #791? |
Well, given above link from the docs, there is different information:
|
It's not a long running cell - the cell is very simple - I've provided an example that exhibits this behaviour in the OP. |
I have tried to run your code, but it seems to run in an infinite loop at with output:
fig.show(renderer="png") That would explain why the notebook conversion is timing out for your code. I have used your provided code given above just up to I have used this command: I am not very versed with plotly, but what wonders me is that you are trying to show the output as a png: png is actually an image format, it should not have any effect on how you display the image. Usually you use a format for writing an output to a file. Here is also no file format when using fig.to_image(format="png", engine="kaleido") So I think the issue here is not nbconvert. Kind regards, |
Thanks for looking into this @d-kleine -- the reason that I wanted plotly to output a png is because their default output (js+svg) is not handled by nbconvert (as mentioned in the OP, also see #1657) and I was trying to see if I could get any output. One of my colleagues managed to workaround the issue (1657) by using beautifulsoup to manipulate the html generated so that the |
Have you seen this post on StackOverflow? I was able to save your code and its output in a html file with this command: with following change in the code (idk if this is crucial, but it worked for me): fig.show(renderer="notebook") see here |
As mentioned, the high level problem was taking a Jupyter Notebook and converting to PDF so that what was displayed when running the report manually in the browser was exactly the same as what was could be generated programatically via nbconvert. This problem was solved by hacking the html generated. As part of trying to get nbconvert to render a plotly chart inside an ipywidgets tab, I encountered this timeout, hence raising this issue - which you have also been able to see "but it seems to run in an infinite loop at..." - is that a bug or is that the expected behaviour of nbconvert? Ultimately our business-level problem (convert a jupyter notebook into a pdf) was solved via hacks, but I feel that #1657 ought to "Just Work", and I don't have much of an opinion of this particular Issue (#1656) so if you want to close it, go for it. |
Per the OP, I was testing with |
Note: This is with nbconvert
6.2.0
from pypi.I'm currently tumbling down a rabbit hole trying to convert our Jupyter notebooks into PDFs. Our notebooks hit an endpoint to pull down content, which is then visualised via Plotly charts and/or ipywidgets. The issue I'm facing is getting plotly+ipywidgets to display correctly with
nbconvert
. Specifically theWebPDFExporter
.I'm now at the point where I'm simply attempting to render a plotly chart as a png inside an ipywidget
Tab
, but even that is not going well!I have a trivial example notebook:
The notebook I pass to nbconvert: report2.c590e4290aef40cf9ded2375446d071f.executed.zip
Running
WebPDFExporter
manually with debug logging shows that there is nonetworkidle0
, just annetworkAlmostIdle
The reason I'm trying to simply display a PNG is that when I use fig.show() I get complete junk output:
Ultimately I want to be able to reuse the same 'widgets' (plotly charts wrapped up in an ipywidget Tab) for the interactive notebooks as well as PDF reports. It doesn't work out-of-the-box, but I'm struggling to get a simple example working that I can build upon. Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: