Skip to content

Latex issue on IDEA #87

@Didou09

Description

@Didou09

Getting an error when running tutorial on IDEA, presumably related to Latex

Image

https://stackoverflow.com/a/69307987

n [4]: sp.display_spectral_model_function('pulse_exp')
Out[4]: 
(ref key  size  nb. data  nb. data monot.
 -------  ----  --------  ---------------
 nf_sm00  1     0         0              
 nx_sm00  4     1         0              
 n0       501   2         1              
 
 data  shape   ref           dim  quant  name  units  bsplines
 ----  ------  ------------  ---  -----  ----  -----  --------
 x     (501,)  ('n0',)                                        
 var   (4,)    ('nx_sm00',)                                   
 y     (501,)  ('n0',)                                        
 
 spect_model  pulse_exp  constraints  free var
 -----------  ---------  -----------  --------
 sm00         1          0            4 / 4   ,
 {'plot': {'handle': <Axes: >, 'type': ['plot']},
  'text': {'handle': <Axes: >, 'type': ['text']}})

Traceback (most recent call last):
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/texmanager.py", line 250, in _run_checked_subprocess
    report = subprocess.check_output(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/.local/share/uv/python/cpython-3.11.11-linux-x86_64-gnu/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/.local/share/uv/python/cpython-3.11.11-linux-x86_64-gnu/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/.local/share/uv/python/cpython-3.11.11-linux-x86_64-gnu/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/data/home/dvezinet/.local/share/uv/python/cpython-3.11.11-linux-x86_64-gnu/lib/python3.11/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'latex'

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

Traceback (most recent call last):
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/backends/backend_qt.py", line 508, in _draw_idle
    self.draw()
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/backends/backend_agg.py", line 382, in draw
    self.figure.draw(self.renderer)
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/artist.py", line 94, in draw_wrapper
    result = draw(artist, renderer, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/artist.py", line 71, in draw_wrapper
    return draw(artist, renderer)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/figure.py", line 3257, in draw
    mimage._draw_list_compositing_images(
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/image.py", line 134, in _draw_list_compositing_images
    a.draw(renderer)
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/artist.py", line 71, in draw_wrapper
    return draw(artist, renderer)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 3210, in draw
    mimage._draw_list_compositing_images(
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/image.py", line 134, in _draw_list_compositing_images
    a.draw(renderer)
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/artist.py", line 71, in draw_wrapper
    return draw(artist, renderer)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/axis.py", line 1405, in draw
    tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/axis.py", line 1332, in _get_ticklabel_bboxes
    return ([tick.label1.get_window_extent(renderer)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/axis.py", line 1332, in <listcomp>
    return ([tick.label1.get_window_extent(renderer)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/text.py", line 969, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/text.py", line 373, in _get_layout
    _, lp_h, lp_d = _get_text_metrics_with_cache(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/text.py", line 69, in _get_text_metrics_with_cache
    return _get_text_metrics_with_cache_impl(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/text.py", line 77, in _get_text_metrics_with_cache_impl
    return renderer_ref().get_text_width_height_descent(text, fontprop, ismath)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/backends/backend_agg.py", line 211, in get_text_width_height_descent
    return super().get_text_width_height_descent(s, prop, ismath)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/backend_bases.py", line 566, in get_text_width_height_descent
    return self.get_texmanager().get_text_width_height_descent(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/texmanager.py", line 363, in get_text_width_height_descent
    dvifile = cls.make_dvi(tex, fontsize)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/texmanager.py", line 295, in make_dvi
    cls._run_checked_subprocess(
  File "/data/home/dvezinet/base/lib/python3.11/site-packages/matplotlib/texmanager.py", line 254, in _run_checked_subprocess
    raise RuntimeError(
RuntimeError: Failed to process string with tex because latex could not be found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions