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

username: MaxM
cooked: <p>Hello again guys,</p>
<p>I’m facing a really simple problem.<br>
I just want to plot some scores.<br>
It is a list with float entries</p>
<p>normal_scores<br>
Out[2]:<br>
[0.5356296896934509,<br>
0.9024431705474854,<br>
0.5813982486724854,<br>
0.3370625376701355,<br>
0.4496380090713501,<br>
0.9165023565292358,<br>
0.24886716902256012,<br>
0.8489370942115784,<br>
0.6777681112289429,<br>
0.448945015668869,<br>
0.7219023108482361,<br>
0.24781900644302368,<br>
0.9817516803741455,<br>
0.46235814690589905,<br>
0.5024040937423706,<br>
0.08573635667562485,<br>
0.6408416628837585,<br>
1.0,<br>
0.7306086421012878,<br>
0.7858248353004456,<br>
0.11039099842309952,<br>
0.6112627983093262]</p>
<p>type(normal_scores)<br>
Out[3]: list</p>
<h1>
<a name="libraries-1" class="anchor" href="#libraries-1"></a>LIBRARIES</h1>
<p>from <strong>future</strong> import print_function<br>
import os<br>
from sklearn.metrics import roc_curve, auc, average_precision_score, f1_score<br>
from scipy.optimize import brentq<br>
from scipy.interpolate import interp1d<br>
import matplotlib.pyplot as plt<br>
from matplotlib import rc<br>
import numpy</p>
<p>plt.plot(normal_scores)</p>
<p>Error Message:</p>
<p>Exception in Tkinter callback<br>
Traceback (most recent call last):<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\texmanager.py”, line 304, in _run_checked_subprocess<br>
stderr=subprocess.STDOUT)<br>
File “C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\subprocess.py”, line 411, in check_output<br>
**kwargs).stdout<br>
File “C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\subprocess.py”, line 488, in run<br>
with Popen(*popenargs, **kwargs) as process:<br>
File “C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\subprocess.py”, line 800, in <strong>init</strong><br>
restore_signals, start_new_session)<br>
File “C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\subprocess.py”, line 1207, in <em>execute_child<br>
startupinfo)<br>
File “C:\Program Files\JetBrains\PyCharm Community Edition 2020.3.4\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_monkey.py”, line 575, in new_CreateProcess<br>
return getattr(<em>subprocess, original_name)(app_name, patch_arg_str_win(cmd_line), *args)<br>
FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden<br>
The above exception was the direct cause of the following exception:<br>
Traceback (most recent call last):<br>
File "C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\tkinter_<em>init</em></em>.py", line 1705, in <strong>call</strong><br>
return self.func(*args)<br>
File "C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\tkinter_<em>init</em></em>.py", line 749, in callit<br>
func(*args)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\backends_backend_tk.py”, line 335, in idle_draw<br>
self.draw()<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\backends\backend_tkagg.py”, line 9, in draw<br>
super(FigureCanvasTkAgg, self).draw()<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\backends\backend_agg.py”, line 388, in draw<br>
self.figure.draw(self.renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\artist.py”, line 38, in draw_wrapper<br>
return draw(artist, renderer, *args, **kwargs)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\figure.py”, line 1709, in draw<br>
renderer, self, artists, self.suppressComposite)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\image.py”, line 135, in _draw_list_compositing_images<br>
a.draw(renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\artist.py”, line 38, in draw_wrapper<br>
return draw(artist, renderer, *args, **kwargs)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\axes_base.py”, line 2645, in draw<br>
mimage._draw_list_compositing_images(renderer, self, artists)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\image.py”, line 135, in _draw_list_compositing_images<br>
a.draw(renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\artist.py”, line 38, in draw_wrapper<br>
return draw(artist, renderer, *args, **kwargs)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\axis.py”, line 1206, in draw<br>
renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\axis.py”, line 1151, in _get_tick_bboxes<br>
for tick in ticks if tick.label1.get_visible()],<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\axis.py”, line 1151, in <br>
for tick in ticks if tick.label1.get_visible()],<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\text.py”, line 890, in get_window_extent<br>
bbox, info, descent = self._get_layout(self._renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\text.py”, line 291, in _get_layout<br>
ismath=“TeX” if self.get_usetex() else False)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\backends\backend_agg.py”, line 201, in get_text_width_height_descent<br>
s, fontsize, renderer=self)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\texmanager.py”, line 448, in get_text_width_height_descent<br>
dvifile = self.make_dvi(tex, fontsize)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\texmanager.py”, line 338, in make_dvi<br>
texfile], tex)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\texmanager.py”, line 308, in _run_checked_subprocess<br>
‘found’.format(command[0])) from exc<br>
RuntimeError: Failed to process string with tex because latex could not be found<br>
Exception in Tkinter callback<br>
Traceback (most recent call last):<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\texmanager.py”, line 304, in _run_checked_subprocess<br>
stderr=subprocess.STDOUT)<br>
File “C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\subprocess.py”, line 411, in check_output<br>
**kwargs).stdout<br>
File “C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\subprocess.py”, line 488, in run<br>
with Popen(*popenargs, **kwargs) as process:<br>
File “C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\subprocess.py”, line 800, in <strong>init</strong><br>
restore_signals, start_new_session)<br>
File “C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\subprocess.py”, line 1207, in _execute_child<br>
startupinfo)<br>
File “C:\Program Files\JetBrains\PyCharm Community Edition 2020.3.4\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_monkey.py”, line 575, in new_CreateProcess<br>
return getattr(<em>subprocess, original_name)(app_name, patch_arg_str_win(cmd_line), *args)<br>
FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden<br>
The above exception was the direct cause of the following exception:<br>
Traceback (most recent call last):<br>
File "C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\tkinter_<em>init</em></em>.py", line 1705, in <strong>call</strong><br>
return self.func(*args)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\backends_backend_tk.py”, line 256, in resize<br>
self.draw()<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\backends\backend_tkagg.py”, line 9, in draw<br>
super(FigureCanvasTkAgg, self).draw()<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\backends\backend_agg.py”, line 388, in draw<br>
self.figure.draw(self.renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\artist.py”, line 38, in draw_wrapper<br>
return draw(artist, renderer, *args, **kwargs)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\figure.py”, line 1709, in draw<br>
renderer, self, artists, self.suppressComposite)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\image.py”, line 135, in _draw_list_compositing_images<br>
a.draw(renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\artist.py”, line 38, in draw_wrapper<br>
return draw(artist, renderer, *args, **kwargs)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\axes_base.py”, line 2645, in draw<br>
mimage._draw_list_compositing_images(renderer, self, artists)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\image.py”, line 135, in _draw_list_compositing_images<br>
a.draw(renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\artist.py”, line 38, in draw_wrapper<br>
return draw(artist, renderer, *args, **kwargs)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\axis.py”, line 1206, in draw<br>
renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\axis.py”, line 1151, in _get_tick_bboxes<br>
for tick in ticks if tick.label1.get_visible()],<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\axis.py”, line 1151, in <br>
for tick in ticks if tick.label1.get_visible()],<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\text.py”, line 890, in get_window_extent<br>
bbox, info, descent = self._get_layout(self._renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\text.py”, line 291, in _get_layout<br>
ismath=“TeX” if self.get_usetex() else False)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\backends\backend_agg.py”, line 201, in get_text_width_height_descent<br>
s, fontsize, renderer=self)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\texmanager.py”, line 448, in get_text_width_height_descent<br>
dvifile = self.make_dvi(tex, fontsize)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\texmanager.py”, line 338, in make_dvi<br>
texfile], tex)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\texmanager.py”, line 308, in _run_checked_subprocess<br>
‘found’.format(command[0])) from exc<br>
RuntimeError: Failed to process string with tex because latex could not be found<br>
Exception in Tkinter callback<br>
Traceback (most recent call last):<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\texmanager.py”, line 304, in _run_checked_subprocess<br>
stderr=subprocess.STDOUT)<br>
File “C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\subprocess.py”, line 411, in check_output<br>
**kwargs).stdout<br>
File “C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\subprocess.py”, line 488, in run<br>
with Popen(*popenargs, **kwargs) as process:<br>
File “C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\subprocess.py”, line 800, in <strong>init</strong><br>
restore_signals, start_new_session)<br>
File “C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\subprocess.py”, line 1207, in <em>execute_child<br>
startupinfo)<br>
File “C:\Program Files\JetBrains\PyCharm Community Edition 2020.3.4\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_monkey.py”, line 575, in new_CreateProcess<br>
return getattr(<em>subprocess, original_name)(app_name, patch_arg_str_win(cmd_line), *args)<br>
FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden<br>
The above exception was the direct cause of the following exception:<br>
Traceback (most recent call last):<br>
File "C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\tkinter_<em>init</em></em>.py", line 1705, in <strong>call</strong><br>
return self.func(*args)<br>
File "C:\Users\Maximilian Miotke.conda\envs\ganomaly\lib\tkinter_<em>init</em></em>.py", line 749, in callit<br>
func(*args)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\backends_backend_tk.py”, line 335, in idle_draw<br>
self.draw()<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\backends\backend_tkagg.py”, line 9, in draw<br>
super(FigureCanvasTkAgg, self).draw()<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\backends\backend_agg.py”, line 388, in draw<br>
self.figure.draw(self.renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\artist.py”, line 38, in draw_wrapper<br>
return draw(artist, renderer, *args, **kwargs)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\figure.py”, line 1709, in draw<br>
renderer, self, artists, self.suppressComposite)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\image.py”, line 135, in _draw_list_compositing_images<br>
a.draw(renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\artist.py”, line 38, in draw_wrapper<br>
return draw(artist, renderer, *args, **kwargs)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\axes_base.py”, line 2645, in draw<br>
mimage._draw_list_compositing_images(renderer, self, artists)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\image.py”, line 135, in _draw_list_compositing_images<br>
a.draw(renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\artist.py”, line 38, in draw_wrapper<br>
return draw(artist, renderer, *args, **kwargs)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\axis.py”, line 1206, in draw<br>
renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\axis.py”, line 1151, in _get_tick_bboxes<br>
for tick in ticks if tick.label1.get_visible()],<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\axis.py”, line 1151, in <br>
for tick in ticks if tick.label1.get_visible()],<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\text.py”, line 890, in get_window_extent<br>
bbox, info, descent = self._get_layout(self._renderer)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\text.py”, line 291, in _get_layout<br>
ismath=“TeX” if self.get_usetex() else False)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\backends\backend_agg.py”, line 201, in get_text_width_height_descent<br>
s, fontsize, renderer=self)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\texmanager.py”, line 448, in get_text_width_height_descent<br>
dvifile = self.make_dvi(tex, fontsize)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\texmanager.py”, line 338, in make_dvi<br>
texfile], tex)<br>
File “C:\Users\Maximilian Miotke\AppData\Roaming\Python\Python37\site-packages\matplotlib\texmanager.py”, line 308, in _run_checked_subprocess<br>
‘found’.format(command[0])) from exc<br>
RuntimeError: Failed to process string with tex because latex could not be found</p>
<p>Does someone know what the problem could be?<br>
Many thanks in advance!</p>
<p>BR<br>
Max</p>

username: ptrblck
cooked: <p>This issue doesn’t seem to be PyTorch-related to you might get a better and faster answer in a matplotlib-specific discussion board or e.g. StackOverflow.</p>
<p>With that being said, I cannot reproduce the issue using <code>plt.plot(normal_scores)</code> and <code>matplotlib</code> successfully creates the plot:<br>
<img src="https://discuss.pytorch.org/uploads/default/original/3X/3/7/37d229eba1854e93749ef28d26b0e53eea1fc570.png" alt="image" data-base62-sha1="7XOx98K3fcqYYpfS8KphajhkHIc" width="372" height="248"></p>