matplotlib-terminal icon indicating copy to clipboard operation
matplotlib-terminal copied to clipboard

plt.show() locking error

Open cyborgdennett opened this issue 1 year ago • 3 comments

Always getting lock error no matter which show I use

>>> plt.show("block")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/casper/dev/notebooks/.venv/lib/python3.12/site-packages/matplotlib/pyplot.py", line 607, in show
    return _get_backend_mod().show(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/casper/dev/notebooks/.venv/lib/python3.12/site-packages/matplotlib_terminal/backend.py", line 128, in show
    manager.canvas.print_terminal(rendering=rendering)
  File "/home/casper/dev/notebooks/.venv/lib/python3.12/site-packages/matplotlib_terminal/backend.py", line 109, in print_terminal
    self.draw(rendering=rendering)
  File "/home/casper/dev/notebooks/.venv/lib/python3.12/site-packages/matplotlib_terminal/backend.py", line 61, in draw
    with self.renderer.lock:
         ^^^^^^^^^^^^^^^^^^

cyborgdennett avatar Jun 30 '24 21:06 cyborgdennett

Funny I was just looking up because of the exact same issue. Python 3.11, matplotlib 3.8.4 The exact cause of the error is: AttributeError: 'MyRenderer' object has no attribute 'lock' Very cool project, thanks.

perrette avatar Jul 04 '24 15:07 perrette

Funny I was just looking up because of the exact same issue. Python 3.11, matplotlib 3.8.4 The exact cause of the error is: AttributeError: 'MyRenderer' object has no attribute 'lock' Very cool project, thanks.

Same.

Has anyone found a solution?

adsmendesdaniel avatar Feb 11 '25 20:02 adsmendesdaniel

I found a workaround: use an older version of matplotlib (3.5.3 works in my case)

mangelett avatar May 06 '25 14:05 mangelett