pyx-project / pyx

Repository of PyX, a Python package for the creation of PostScript, PDF, and SVG files.
https://pyx-project.org/
GNU General Public License v2.0
109 stars 18 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'tex' #27

Closed beucismis closed 3 years ago

beucismis commented 3 years ago

Code:

    c.text(
        CODE_X_POS[page_id_pos] + TEXT_X_OFFSET,
        CODE_Y_POS[page_id_pos] + TEXT_Y_OFFSET,
        "{} ({}/{})".format(ASC_FILE, bc + 1, len(CODE_BLOCKS)),
    )

Error:

Traceback (most recent call last):
  File "/home/adil/Projects/paperbackup/main.py", line 76, in <module>
    c.text(
  File "/home/adil/.local/lib/python3.9/site-packages/pyx/canvas.py", line 409, in text
    return self.insert(self.textengine.text(x, y, atext, *args, **kwargs))
  File "/home/adil/.local/lib/python3.9/site-packages/pyx/text.py", line 1454, in wrapped
    return f(self, *args, **kwargs)
  File "/home/adil/.local/lib/python3.9/site-packages/pyx/text.py", line 1490, in text
    return self.instance.text(*args, **kwargs)
  File "/home/adil/.local/lib/python3.9/site-packages/pyx/text.py", line 1330, in text
    return self.text_pt(unit.topt(x), unit.topt(y), *args, **kwargs)
  File "/home/adil/.local/lib/python3.9/site-packages/pyx/text.py", line 1304, in text_pt
    left_pt, right_pt, height_pt, depth_pt = self.do_typeset(expr, self.texmessages_run_default + self.texmessages_run + texmessages)
  File "/home/adil/.local/lib/python3.9/site-packages/pyx/text.py", line 1221, in do_typeset
    self.do_start()
  File "/home/adil/.local/lib/python3.9/site-packages/pyx/text.py", line 1370, in do_start
    super().do_start()
  File "/home/adil/.local/lib/python3.9/site-packages/pyx/text.py", line 1176, in do_start
    self.popen = config.Popen(cmd, stdin=config.PIPE, stdout=config.PIPE, stderr=config.STDOUT, bufsize=0)
  File "/home/adil/.local/lib/python3.9/site-packages/pyx/config.py", line 218, in Popen
    return subprocess.Popen(cmd, *args, **kwargs)
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'tex'
beucismis commented 3 years ago

Problem is solved....

$ apt install texlive-fonts-recommended texlive-fonts-extra dvipng