Skip to content

Instantly share code, notes, and snippets.

@davipatti
Created March 27, 2023 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davipatti/0ae93ddc4dacd0ba9e6ac54b30472926 to your computer and use it in GitHub Desktop.
Save davipatti/0ae93ddc4dacd0ba9e6ac54b30472926 to your computer and use it in GitHub Desktop.
[jupyter nbconvert can't export interactive plotly plots from vscode] #vscode #jupyter #nbconvert

Getting this type of error when trying to convert an ipynb containing an interactive plotly figure generated in vscode.

$ jupyter nbconvert test.ipynb
[NbConvertApp] Converting notebook test.ipynb to html
.../pelican-env/lib/python3.11/site-packages/nbconvert/filters/datatypefilter.py:39: UserWarning: Your element with mimetype(s) dict_keys(['application/vnd.plotly.v1+json']) is not able to be represented.
  warn("Your element with mimetype(s) {mimetypes}"
[NbConvertApp] Writing 330169 bytes to test.html

The current workaround (from this bug report) is to add renderer='notebook' to the call to fig.show. I.e.:

fig.show(renderer='notebook')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment