Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nbconvert use '--allow-chromium-download'

I tried downloading a Jupyter Notebook as pdf by clicking on File -> Download as -> Pdf via pyppeteer. I get the below error while doing so:

nbconvert failed: No suitable chromium executable found on the system. Please use '--allow-chromium-download' to allow downloading one.

I had installed pyppeteer using command conda install -c conda-forge pyppeteer . Now I am trying to download the pdf via Jupyter GUI but it fails.

How can I do that ? And do I need to run some Command on anaconda terminal to do it?

like image 854
Invictus Avatar asked Mar 07 '21 07:03

Invictus


People also ask

How do I download a PDF from jupyter?

The Jupyter Notebook has an option to export the notebook to many formats. It can be accessed by clicking File -> Download as -> PDF via LaTeX (or PDF via HTML - not visible in the screenshot).

What is Nbconvert?

Primarily, the nbconvert tool allows you to convert a Jupyter . ipynb notebook document file into another static format including HTML, LaTeX, PDF, Markdown, reStructuredText, and more. nbconvert can also add productivity to your workflow when used to execute notebooks programmatically.

How do I use the nbconvert tool?

The nbconvert tool allows you to convert an .ipynb notebook file into various static formats including: From the command line, use nbconvert to convert a Jupyter notebook ( input) to a a different format ( output ).

Why can’t I use nbconvert to convert notebooks to PDF?

macOS (OS X): MacTeX. Because nbconvert depends on packages and fonts included in standard TeX distributions, if you do not have a complete installation, you may not be able to use nbconvert’s standard tooling to convert notebooks to PDF. For converting notebooks to PDF with --to webpdf, nbconvert requires the Pyppeteer Chromium automation library.

What does nbconvert failed mean?

nbconvert failed: No suitable chromium executable found on the system. Please use '--allow-chromium-download' to allow downloading one Getting error as "nbconvert failed: No suitable chromium executable found on the system. Please use '--allow-chromium-download' to allow downloading one."

What do I need to install nbconvert?

Nbconvert is packaged for both pip and conda, so you can install it with: The Miniconda and Miniforge distributions both provide a minimal conda installation. To unlock its full capabilities, nbconvert requires Pandoc, TeX (specifically, XeLaTeX) and Pyppeteer.


2 Answers

Try in your terminal this command using your notebook:

jupyter nbconvert --to webpdf --allow-chromium-download Untitled.ipynb

where "Untitled.ipynb" is the name of your notebook.

this should download chromium

like image 122
Juan Costamagna Avatar answered Sep 19 '22 18:09

Juan Costamagna


Above issue can be fixed by installing the missing package

  1. open the anaconda terminal enter image description here
  2. Type the command pyppeteer-install in the terminal. This will download and install an appropriate version of chromium.

enter image description here

like image 42
Marinko Avatar answered Sep 20 '22 18:09

Marinko