1

我有这个脚本可以并行绘制很多数字。当我在 ipython 中运行它来测试它时,它运行良好,但是当我提交一个并行运行的作业脚本时,它在尝试注释某些文本时失败。它失败的部分如下:

time_string = "$t$="+str(int(time_val))+"yr"
time_string_raw = r'{}'.format(time_string)
time_text = ax.text((xlim[0]+0.01*(xlim[1]-xlim[0])), (ylim[1]-0.03*(ylim[1]-ylim[0])), time_string_raw, va="center", ha="left", color='w', fontsize=args.text_font)
plt.savefig("Test_802.jpg", format='jpg', bbox_inches='tight')

错误信息是:

 File "movie_script.py", line 804, in <module>
    plt.savefig("Test_802.jpg", format='jpg', bbox_inches='tight')
  File "home/.local/lib/python3.7/site-packages/matplotlib/pyplot.py", line 723, in savefig
    res = fig.savefig(*args, **kwargs)
  File "home/.local/lib/python3.7/site-packages/matplotlib/figure.py", line 2203, in savefig
    self.canvas.print_figure(fname, **kwargs)
  File "home/.local/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 2126, in print_figure
    **kwargs)
  File "home/.local/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py", line 358, in wrapper
    return func(*args, **kwargs)
  File "home/.local/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py", line 584, in print_jpg
    FigureCanvasAgg.draw(self)
  File "home/.local/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py", line 393, in draw
    self.figure.draw(self.renderer)
  File "home/.local/lib/python3.7/site-packages/matplotlib/artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "home/.local/lib/python3.7/site-packages/matplotlib/figure.py", line 1736, in draw
    renderer, self, artists, self.suppressComposite)
  File "home/.local/lib/python3.7/site-packages/matplotlib/image.py", line 137, in _draw_list_compositing_images
    a.draw(renderer)
  File "home/.local/lib/python3.7/site-packages/matplotlib/artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "home/.local/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 2630, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)
  File "home/.local/lib/python3.7/site-packages/matplotlib/image.py", line 137, in _draw_list_compositing_images
    a.draw(renderer)
  File "home/.local/lib/python3.7/site-packages/matplotlib/artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "home/.local/lib/python3.7/site-packages/matplotlib/axis.py", line 1232, in draw
    tick.draw(renderer)
  File "home/.local/lib/python3.7/site-packages/matplotlib/artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "home/.local/lib/python3.7/site-packages/matplotlib/axis.py", line 297, in draw
    artist.draw(renderer)
  File "home/.local/lib/python3.7/site-packages/matplotlib/artist.py", line 38, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "home/.local/lib/python3.7/site-packages/matplotlib/text.py", line 729, in draw
    mtext=mtext)
  File "home/.local/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py", line 229, in draw_tex
    Z = texmanager.get_grey(s, size, self.dpi)
  File "home/.local/lib/python3.7/site-packages/matplotlib/texmanager.py", line 413, in get_grey
    pngfile = self.make_png(tex, fontsize, dpi)
  File "home/.local/lib/python3.7/site-packages/matplotlib/texmanager.py", line 404, in make_png
    self._run_checked_subprocess(cmd, tex)
  File "home/.local/lib/python3.7/site-packages/matplotlib/texmanager.py", line 310, in _run_checked_subprocess
    'found'.format(command[0])) from exc
P082 yt : [ERROR    ] 2020-07-01 11:02:55,300 RuntimeError: Failed to process string with tex because dvipng could not be found
4

0 回答 0