Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IPython/Jupyter Problems saving notebook as PDF

So, i've been trying to save a jupyter notebook as PDF but i just can't figure out how to do this. The first thing i try is from the file menu just download as PDF, but doing that results in:

nbconvert failed: PDF creating failed 

the next thing i try is try to do the conversion from the Command Prompt like this

$ ipython nbconvert --to latex --post PDF MyNotebook.ipynb  

but again, this results in an error message

ImportError: No module named 'PDF' 

and if i try

$ ipython nbconvert --to latex MyNotebook.ipynb  

this results in

IPython.nbconvert.utils.pandoc.PandocMissing: Pandoc wasn't found: Please check that pandoc is installed 

if i try to install pandoc (pip install pandoc), this gives me

ImportError: No module named 'ConfigParser' 

and this is where i get stuck because i just don't know what else to do. Anyone have idea how to fix whatever is wrong?

like image 906
Isak Baizley Avatar asked Mar 19 '15 23:03

Isak Baizley


People also ask

How do I save an Ipython notebook as a PDF?

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).

How do I save my notebook as a PDF?

Create a notebook and the click "File -> Download As". Click the new menu entry called "PDF via HTML". Your notebook will be converted to a PDF on the fly and then downloaded.

How do I save an Ipython notebook?

Saving your edits is simple. There is a disk icon in the upper left of the Jupyter tool bar. Click the save icon and your notebook edits are saved.

How do I save VS code in Ipynb as PDF?

To export, select the Export action on the main toolbar. You'll then be presented with a dropdown of file format options. Note: For PDF export, you must have TeX installed. If you don't, you will be notified that you need to install it when you select the PDF option.


1 Answers

To make it work, I installed latex, typical latex extra, and pandoc.

With ubuntu:

sudo apt-get install texlive texlive-latex-extra pandoc 

it takes some times: several 100 Mb to download. I read somewhere that you can use --no-install-recommends for texlive and extra to reduce to the dl.

like image 166
Juh_ Avatar answered Sep 19 '22 15:09

Juh_