Do you have MicroPython (Raspberry Pi Pico) selected as your interpreter in Thonny (bottom right)? The reference to cpython_backend.py makes me think Thonny might be trying to run your code with the wrong Python interpreter…
You’ll need to be running a recent version of Thonny to be able to select this option.
Thank you for your answer.
Too new to this micro controller programming… so I was not knowing about this.
I changed it to the Pico’s Micro-Python and now it works fine.
I am trying to run now the code for the rgbmatrix5x5