[pyar] Jupyter PDF via LaTeX
Marcelo Nicolas Manso
nicolasmanso en gmail.com
Sab Mayo 14 07:34:18 ART 2016
On 05/14/2016 03:13 AM, Horacio Mayo wrote:
> Hola Comunidad:
>
> Tengo problemas con el Notebook de Ipython (Jupyter), intento utilizar
> File > Download as > PDF via LaTeX (.pdf) y me tira:
>
> 500 : Internal Server Error The error was: nbconvert failed: pdflatex
> not found on PATH
>
> Intento también hacerlo por la terminal:
>
> horacio en horacio-nakama:~/anaconda3/experimentos$ ipython nbconvert --to
> pdf experimentos.ipynb
>
> [NbConvertApp] Converting notebook experimentos.ipynb to pdf
> [NbConvertApp] Support files will be in experimentos_files/
> [NbConvertApp] Making directory experimentos_files
> [NbConvertApp] Making directory experimentos_files
> [NbConvertApp] Writing 30194 bytes to notebook.tex
> [NbConvertApp] Building PDF
> Traceback (most recent call last):
> File "/home/horacio/anaconda3/bin/ipython", line 6, in <module>
> sys.exit(start_ipython())
> File
> "/home/horacio/anaconda3/lib/python3.5/site-packages/IPython/__init__.py",
> line 119, in start_ipython
> return launch_new_instance(argv=argv, **kwargs)
> File
> "/home/horacio/anaconda3/lib/python3.5/site-packages/traitlets/config/application.py",
> line 589, in launch_instance
> app.start()
> File
> "/home/horacio/anaconda3/lib/python3.5/site-packages/IPython/terminal/ipapp.py",
> line 349, in start
> return self.subapp.start()
> File
> "/home/horacio/anaconda3/lib/python3.5/site-packages/nbconvert/nbconvertapp.py",
> line 293, in start
> self.convert_notebooks()
> File
> "/home/horacio/anaconda3/lib/python3.5/site-packages/nbconvert/nbconvertapp.py",
> line 457, in convert_notebooks
> self.convert_single_notebook(notebook_filename)
> File
> "/home/horacio/anaconda3/lib/python3.5/site-packages/nbconvert/nbconvertapp.py",
> line 428, in convert_single_notebook
> output, resources = self.export_single_notebook(notebook_filename,
> resources, input_buffer=input_buffer)
> File
> "/home/horacio/anaconda3/lib/python3.5/site-packages/nbconvert/nbconvertapp.py",
> line 357, in export_single_notebook
> output, resources = self.exporter.from_filename(notebook_filename,
> resources=resources)
> File
> "/home/horacio/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/exporter.py",
> line 165, in from_filename
> return self.from_file(f, resources=resources, **kw)
> File
> "/home/horacio/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/exporter.py",
> line 183, in from_file
> return self.from_notebook_node(nbformat.read(file_stream,
> as_version=4), resources=resources, **kw)
> File
> "/home/horacio/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/pdf.py",
> line 167, in from_notebook_node
> rc = self.run_latex(tex_file)
> File
> "/home/horacio/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/pdf.py",
> line 129, in run_latex
> self.latex_count, log_error)
> File
> "/home/horacio/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/pdf.py",
> line 91, in run_command
> raise OSError("%s not found on PATH" % command_list[0])
> OSError: pdflatex not found on PATH
>
> If you suspect this is an IPython bug, please report it at:
> https://github.com/ipython/ipython/issues
> or send an email to the mailing list at ipython-dev en scipy.org
> <mailto:ipython-dev en scipy.org>
>
> You can print a more detailed traceback right now with "%tb", or use
> "%debug"
> to interactively debug it.
>
> Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
> c.Application.verbose_crash=True
>
> Estoy utilizando Ubuntu 14.04 (64-bits), Python 3.5.1 que instale con
> Anaconda 2.5.0(64-bits).
>
> Intenté encontrar la solución sin éxito, si pudieran darme una mano de
> como arreglarlo.
Horacio,
Es posible que te este faltando tener instalado LaTeX[0] en el SO? según
el trace el programa no esta pudiendo encontrar pdflatex.
Si ejecutas 'which pdflatex' en la consola te debería aparecer el path
donde esta el binario, por ejemplo: /usr/bin/pdflatex.
Saludos
[0] https://help.ubuntu.com/community/LaTeX
--
Marcelo Nicolas Manso (nicoman)
http://www.nicolasmanso.com.ar
Más información sobre la lista de distribución pyar