This repository was archived by the owner on Jul 28, 2025. It is now read-only.
Description Problem
Another community member and I were trying to see if Matplotlib's animation.FuncAnimation would work in PyScript using this Matplotlib demo .
We ran into the following error:
AttributeError: 'TimerWasm' object has no attribute '_timer'
The code is available here on PyScript.com .
More Details
Here's the stack trace of the error:
Traceback (most recent call last ):
File "/lib/python311.zip/_pyodide/_base.py" , line 499 , in eval_code
.run (globals , locals )
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
File "/lib/python311.zip/_pyodide/_base.py" , line 340 , in run
coroutine = eval (self .code , globals , locals )
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
File "<exec>" , line 78 , in < module >
File "/lib/python3.11/site-packages/matplotlib/animation.py" , line 1634 , in __init__
super ().__init__ (fig , ** kwargs )
File "/lib/python3.11/site-packages/matplotlib/animation.py" , line 1395 , in __init__
event_source = fig .canvas .new_timer (interval = self ._interval )
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
File "/lib/python3.11/site-packages/matplotlib_pyodide/browser_backend.py" , line 416 , in new_timer
return TimerWasm (* args , ** kwargs )
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
File "/lib/python3.11/site-packages/matplotlib/backend_bases.py" , line 1097 , in __init__
self .interval = 1000 if interval is None else interval
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
File "/lib/python3.11/site-packages/matplotlib/backend_bases.py" , line 1139 , in interval
self ._timer_set_interval ()
File "/lib/python3.11/site-packages/matplotlib_pyodide/browser_backend.py" , line 510 , in _timer_set_interval
if self ._timer is not None :
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
AttributeError : 'TimerWasm' object has no attribute '_timer'