#24484 closed defect (fixed)

nbconvert broken after the upgrade to Jupyter 5.2.1

Reported by: egourgoulhon Owned by: embray
Priority: blocker Milestone: sage-8.2
Component: packages: standard Keywords: jupyter, nbconvert
Cc: nthiery, slelievre, embray Merged in:
Authors: Erik Bray, Volker Braun Reviewers: Eric Gourgoulhon
Report Upstream: N/A Work issues:
Branch: 31e3cdf (Commits) Commit: 31e3cdf0e86f9d757142b55158851ab22550cbeb
Dependencies: Stopgaps:

Description (last modified by embray)

After the upgrade to Jupyter 5.2.1 implemented in #24168 (merged in Sage 8.2.beta0), the export of a notebook to another format fails, whatever the format. For instance, clicking on File -> Download as -> PDF via LaTeX leads to

500 : Internal Server Error

The error was:

Could not import nbconvert: No module named base

This was reported in https://groups.google.com/d/msg/sage-devel/Qsf9Gb4pDt4/vIORrWIABwAJ

This ticket fixes this as follows:

  • upgrade to nbconvert 5.3.1 (from 4.2.0)
  • add testpath 0.3.1 and make it standard
  • upgrade to pandocfilters 1.4.2 (from 1.3.0) and make it standard (from optional)
  • add nbconvert dependencies: pandocfilters, testpath, bleach=>html5lib=>webencodings

Upstream tarballs: https://pypi.python.org/packages/eb/ea/58428609442130dc31d3a59010bf6cbd263a16c589d01d23b7c1e6997e3b/bleach-2.1.3.tar.gz https://pypi.python.org/packages/85/3e/cf449cf1b5004e87510b9368e7a5f1acd8831c2d6691edd3c62a0823f98f/html5lib-1.0.1.tar.gz https://pypi.python.org/packages/b9/a4/d0a0938ad6f5eeb4dea4e73d255c617ef94b0b2849d51194c9bbdb838412/nbconvert-5.3.1.tar.gz https://pypi.python.org/packages/f4/8b/b71e9ee10e5f751e9d959bc750ab122ba04187f5aa52aabdc4e63b0e31a7/testpath-0.3.1.tar.gz https://pypi.python.org/packages/0b/02/ae6ceac1baeda530866a85075641cec12989bd8d31af6d5ab4a3e8c92f47/webencodings-0.5.1.tar.gz

Change History (16)

comment:1 Changed 22 months ago by egourgoulhon

  • Cc nthiery added
  • Description modified (diff)

comment:2 Changed 22 months ago by vbraun

  • Branch set to u/vbraun/nbconvert_broken_after_the_upgrade_to_jupyter_5_2_1

comment:3 Changed 22 months ago by slelievre

  • Cc slelievre added
  • Commit set to 7802a3fbb92d6a8f2f4f0117e454635e6d0536e8
  • Description modified (diff)

Adding outline of the fix to ticket description.

New commits:

7802a3fUpdate nbconvert and add new dependencies

comment:4 Changed 22 months ago by egourgoulhon

Is this ready for review?

comment:5 Changed 22 months ago by vbraun

no there is still a trail of dependencies... i stopped at html5lib for now.

comment:6 Changed 21 months ago by nthiery

Hi Volker,

For #23362, we need to upgrade pandocfilters too (and nothing else). Do you mind if we take over the two related diffs there?

comment:7 Changed 21 months ago by nthiery

Hi again:

To get things moving and for testing, I have pushed a branch with those diffs to #23362; waiting for your confirmation.

Strangely enough, I did not get the same checksums. You downloaded the tarbal from https://github.com/jgm/pandocfilters/releases, right?



comment:8 Changed 21 months ago by vbraun

Feel free to move stuff to separate ticket. I got pandocfilters from https://pypi.python.org/pypi/pandocfilters which does list the same md5....

comment:9 Changed 21 months ago by nthiery

I see. Thanks for the feedback!

I had downloaded the tarball from github, according to the instructions in the SPKG.txt, and indeed the two tarballs differ slightly:

Seulement dans pandocfilters-1.4.2-github/examples: gabc-score.gabc
Seulement dans pandocfilters-1.4.2-github/examples: lilypond-score.ly
Seulement dans pandocfilters-1.4.2-github: .gitignore
Seulement dans pandocfilters-1.4.2-github: MANIFEST.in
Seulement dans pandocfilters-1.4.2-github: PACKAGING
Seulement dans pandocfilters-1.4.2: PKG-INFO

It's reasonable to use pypi as authoritative source since we want to stay close to a usual pip install. So I updated the instructions in SPKG.txt and reverted to your checksums in #23362.

comment:10 Changed 21 months ago by vbraun

Most likely, the github tarball is just the git repo whereas the file on pypi is the output of setup.py sdist.

comment:11 Changed 19 months ago by embray

  • Cc embray added

comment:12 Changed 19 months ago by embray

  • Owner changed from (none) to embray

I'll take care of finishing this up.

comment:13 Changed 19 months ago by embray

  • Authors set to Erik Bray, Volker Braun
  • Branch changed from u/vbraun/nbconvert_broken_after_the_upgrade_to_jupyter_5_2_1 to u/embray/misc/ticket-24484
  • Commit changed from 7802a3fbb92d6a8f2f4f0117e454635e6d0536e8 to 31e3cdf0e86f9d757142b55158851ab22550cbeb

New commits:

6470fb6Update nbconvert and add new dependencies
a9198c7Add 'bleach' as a standard package (dependency of 'nbconvert')
c0aab2bAdd 'html5lib' as a standard package (dependency of 'bleach')
31e3cdfAdd 'webencodings' as a standard package (dependency of 'html5lib')

comment:14 Changed 19 months ago by embray

  • Description modified (diff)
  • Status changed from new to needs_review

Rebased to incorporate #23362; added additional missing dependencies bleach, html5lib, and webencodings.

Confirmed that this fixed the issue for me. I can now export notebooks in various formats.

comment:15 Changed 19 months ago by egourgoulhon

  • Reviewers set to Eric Gourgoulhon
  • Status changed from needs_review to positive_review

Many thanks for the fix! I confirmed it works (Ubuntu 16.04); I simply had to install the Ubuntu package textlive-xetex to enable the PDF export. There remains the bug reported in #23330, but this is a separate issue (and definitively not a blocker).

comment:16 Changed 19 months ago by vbraun

  • Branch changed from u/embray/misc/ticket-24484 to 31e3cdf0e86f9d757142b55158851ab22550cbeb
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.