How to install latex for the code to work ?

33 views
Skip to first unread message

Binod Bhattarai

unread,
Jan 19, 2020, 3:13:30 PM1/19/20
to astroML-general
I'm getting the following error.
Can anyone help how I can install latex to work with spyder.
I am using spyder bundled under anaconda.

runfile('C:/Users/binod/.spyder-py3/temp.py', wdir='C:/Users/binod/.spyder-py3')
@pickle_results: using precomputed results from 'spec_LLE.pkl'
Traceback (most recent call last):

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\texmanager.py", line 304, in _run_checked_subprocess
    stderr=subprocess.STDOUT)

  File "C:\Users\binod\Anaconda3\lib\subprocess.py", line 411, in check_output
    **kwargs).stdout

  File "C:\Users\binod\Anaconda3\lib\subprocess.py", line 488, in run
    with Popen(*popenargs, **kwargs) as process:

  File "C:\Users\binod\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 104, in __init__
    super(SubprocessPopen, self).__init__(*args, **kwargs)

  File "C:\Users\binod\Anaconda3\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)

  File "C:\Users\binod\Anaconda3\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)

FileNotFoundError: [WinError 2] The system cannot find the file specified


The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "C:\Users\binod\Anaconda3\lib\site-packages\IPython\core\formatters.py", line 341, in __call__
    return printer(obj)

  File "C:\Users\binod\Anaconda3\lib\site-packages\IPython\core\pylabtools.py", line 244, in <lambda>
    png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))

  File "C:\Users\binod\Anaconda3\lib\site-packages\IPython\core\pylabtools.py", line 128, in print_figure
    fig.canvas.print_figure(bytes_io, **kw)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\backend_bases.py", line 2056, in print_figure
    **kwargs)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 527, in print_png
    FigureCanvasAgg.draw(self)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 388, in draw
    self.figure.draw(self.renderer)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\figure.py", line 1709, in draw
    renderer, self, artists, self.suppressComposite)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\image.py", line 135, in _draw_list_compositing_images
    a.draw(renderer)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\axes\_base.py", line 2647, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\image.py", line 135, in _draw_list_compositing_images
    a.draw(renderer)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\axis.py", line 1205, in draw
    renderer)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\axis.py", line 1152, in _get_tick_bboxes
    for tick in ticks if tick.label2.get_visible()])

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\axis.py", line 1152, in <listcomp>
    for tick in ticks if tick.label2.get_visible()])

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\text.py", line 890, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\text.py", line 291, in _get_layout
    ismath="TeX" if self.get_usetex() else False)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 201, in get_text_width_height_descent
    s, fontsize, renderer=self)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\texmanager.py", line 448, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\texmanager.py", line 338, in make_dvi
    texfile], tex)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\texmanager.py", line 308, in _run_checked_subprocess
    'found'.format(command[0])) from exc

RuntimeError: Failed to process string with tex because latex could not be found

<Figure size 360x270 with 4 Axes>
Traceback (most recent call last):

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\texmanager.py", line 304, in _run_checked_subprocess
    stderr=subprocess.STDOUT)

  File "C:\Users\binod\Anaconda3\lib\subprocess.py", line 411, in check_output
    **kwargs).stdout

  File "C:\Users\binod\Anaconda3\lib\subprocess.py", line 488, in run
    with Popen(*popenargs, **kwargs) as process:

  File "C:\Users\binod\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 104, in __init__
    super(SubprocessPopen, self).__init__(*args, **kwargs)

  File "C:\Users\binod\Anaconda3\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)

  File "C:\Users\binod\Anaconda3\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)

FileNotFoundError: [WinError 2] The system cannot find the file specified


The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "C:\Users\binod\Anaconda3\lib\site-packages\IPython\core\formatters.py", line 341, in __call__
    return printer(obj)

  File "C:\Users\binod\Anaconda3\lib\site-packages\IPython\core\pylabtools.py", line 244, in <lambda>
    png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))

  File "C:\Users\binod\Anaconda3\lib\site-packages\IPython\core\pylabtools.py", line 128, in print_figure
    fig.canvas.print_figure(bytes_io, **kw)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\backend_bases.py", line 2056, in print_figure
    **kwargs)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 527, in print_png
    FigureCanvasAgg.draw(self)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 388, in draw
    self.figure.draw(self.renderer)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\figure.py", line 1709, in draw
    renderer, self, artists, self.suppressComposite)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\image.py", line 135, in _draw_list_compositing_images
    a.draw(renderer)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\axes\_base.py", line 2647, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\image.py", line 135, in _draw_list_compositing_images
    a.draw(renderer)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\axis.py", line 1205, in draw
    renderer)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\axis.py", line 1152, in _get_tick_bboxes
    for tick in ticks if tick.label2.get_visible()])

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\axis.py", line 1152, in <listcomp>
    for tick in ticks if tick.label2.get_visible()])

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\text.py", line 890, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\text.py", line 291, in _get_layout
    ismath="TeX" if self.get_usetex() else False)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 201, in get_text_width_height_descent
    s, fontsize, renderer=self)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\texmanager.py", line 448, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\texmanager.py", line 338, in make_dvi
    texfile], tex)

  File "C:\Users\binod\Anaconda3\lib\site-packages\matplotlib\texmanager.py", line 308, in _run_checked_subprocess
    'found'.format(command[0])) from exc

RuntimeError: Failed to process string with tex because latex could not be found

<Figure size 360x270 with 4 Axes>

Brigitta Sipocz

unread,
Feb 3, 2020, 5:32:16 PM2/3/20
to astroML-general, Binod Bhattarai
Hi Binod,

Unfortunately I don't know how to set up a working latex installation on windows. However, if the sole reason you need latex is to run the astroML examples, I would suggest to use uselatex=False in the line setup_text_plots(fontsize=8, usetex=True) that is present at most figure example code. The purpose of that line is to generate the same pdf that has been used in the book manuscript, but otherwise there is no other reason to require latex to explore the functionality the figure demonstrate.


Hope it helps,
 Brigitta

--
You received this message because you are subscribed to the Google Groups "astroML-general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astroml-gener...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astroml-general/3215cdea-262b-41f8-97e5-1957de7bd09a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages