Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with matplotlib locks when using multiprocessing #14

Open
multiwavelength opened this issue Dec 2, 2020 · 0 comments
Open

Issue with matplotlib locks when using multiprocessing #14

multiwavelength opened this issue Dec 2, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@multiwavelength
Copy link
Owner

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 51, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
  File "/home/andra/.local/lib/python3.8/site-packages/gleam/main.py", line 108, in run_main
    pg.plot_spectrum(
  File "/home/andra/.local/lib/python3.8/site-packages/gleam/plot_gaussian.py", line 240, in plot_spectrum
    fig.savefig(f"{basename}.png", format="png", bbox_inches="tight")
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/figure.py", line 2311, in savefig
    self.canvas.print_figure(fname, **kwargs)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 2193, in print_figure
    self.figure.draw(renderer)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/figure.py", line 1863, in draw
    mimage._draw_list_compositing_images(
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
    a.draw(renderer)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/cbook/deprecation.py", line 411, in wrapper
    return func(*inner_args, **inner_kwargs)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 2747, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
    a.draw(renderer)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/artist.py", line 41, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/axis.py", line 1165, in draw
    ticklabelBoxes, ticklabelBoxes2 = self._get_tick_bboxes(ticks_to_draw,
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/axis.py", line 1091, in _get_tick_bboxes
    return ([tick.label1.get_window_extent(renderer)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/axis.py", line 1091, in <listcomp>
    return ([tick.label1.get_window_extent(renderer)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/text.py", line 902, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/text.py", line 295, in _get_layout
    w, h, d = renderer.get_text_width_height_descent(
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/backends/backend_agg.py", line 227, in get_text_width_height_descent
    w, h, d = texmanager.get_text_width_height_descent(
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/texmanager.py", line 423, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/texmanager.py", line 309, in make_dvi
    self._run_checked_subprocess(
  File "/usr/lib/python3.8/contextlib.py", line 120, in __exit__
    next(self.gen)
  File "/home/andra/.local/lib/python3.8/site-packages/matplotlib/cbook/__init__.py", line 1814, in _lock_path
    lock_path.unlink()
  File "/usr/lib/python3.8/pathlib.py", line 1321, in unlink
    self._accessor.unlink(self)
FileNotFoundError: [Errno 2] No such file or directory: '/home/andra/.cache/matplotlib/tex.cache/7b049115a0b65bb660d58d081a8c2c63.tex.matplotlib-lock'
"""

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

Traceback (most recent call last):
  File "/home/andra/.local/bin/gleam", line 8, in <module>
    sys.exit(pipeline())
  File "/home/andra/.local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/andra/.local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/andra/.local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/andra/.local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/andra/.local/lib/python3.8/site-packages/gleam/__init__.py", line 136, in pipeline
    p.starmap(gleam.main.run_main, unique_sources)
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 372, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 771, in get
    raise self._value
FileNotFoundError: [Errno 2] No such file or directory: '/home/andra/.cache/matplotlib/tex.cache/7b049115a0b65bb660d58d081a8c2c63.tex.matplotlib-lock'
Command exited with non-zero status 1
@multiwavelength multiwavelength added the bug Something isn't working label Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant