WassimTenachi/PhySO

Error running program_display_UnitTest.py because of missing dependencies

ale-munozarancibia opened this issue · 1 comments

Hi,

I encountered an error when running the unit tests that I was able to solve installing further packages. The error was the following:

FAIL: test_tree_rpr (physo.physym.tests.program_display_UnitTest.DisplayTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ammunoz1/Desktop/Ficheros/PhySO/PhySO/physo/physym/tests/program_display_UnitTest.py", line 160, in test_tree_rpr
    tree_latex = my_programs.get_tree_latex(prog_idx=0,)
  File "/home/ammunoz1/Desktop/Ficheros/PhySO/PhySO/physo/physym/program.py", line 2674, in get_tree_latex
    tree_latex = dot2tex.dot2tex(G.to_string(),
  File "/home/ammunoz1/.local/lib/python3.9/site-packages/dot2tex/__init__.py", line 62, in dot2tex
    return d2t.convert_graph(dotsource, **kwargs)
  File "/home/ammunoz1/.local/lib/python3.9/site-packages/dot2tex/dot2tex.py", line 3125, in convert_graph
    tex = main(True, dotsource, options)
  File "/home/ammunoz1/.local/lib/python3.9/site-packages/dot2tex/dot2tex.py", line 3075, in main
    s = conv.convert(dotdata)
  File "/home/ammunoz1/.local/lib/python3.9/site-packages/dot2tex/dot2tex.py", line 800, in convert
    return self.do_preview_preproc()
  File "/home/ammunoz1/.local/lib/python3.9/site-packages/dot2tex/dot2tex.py", line 1062, in do_preview_preproc
    sys.exit(1)
SystemExit: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ammunoz1/Desktop/Ficheros/PhySO/PhySO/physo/physym/tests/program_display_UnitTest.py", line 164, in test_tree_rpr
    self.fail("Tree generation failed : get_tree_latex")
AssertionError: Tree generation failed : get_tree_latex

Upon checking dot2tex.py around line 1062, it included this error message:

Failed to preprocess the graph.
Is the preview LaTeX package installed? ((Debian package preview-latex-style)
To see what happened, run dot2tex with the --debug option.

I indeed did not have that package, and according to https://ctan.org/pkg/preview-latex it is provided with auctex. In Fedora 35 I installed emacs-auctex using dnf and after that I did not encounter the get_tree_latex error. However, dnf also installed other packages (emacs, emacs-common, liblockfile, libotf and tex-preview), so I am not sure which of them actually solved the problem. I thought this info could be useful to you for adding missing dependencies in the lists of requirements.

Hi @ale-munozarancibia,

Thank you very much for this !
PhySO requires latex as it uses it to display equations, I am trying to make the installation simpler on all platforms but it is not obvious how to do that, this will definitely help !

Cheers.
Wassim