I am trying to use ipycanvas in Jupyter notebook with SageMath 9.3 (I also tried 9.3.rc2) for macOS 11.4, and Python 3. When I was using SageMath 9.2 and Python 3 ipycanvas was working fine, but when I updated sage to SageMath 9.3 I started having problems.
The first thing I did was installing again ipycanvas on my mac terminal
$ sage —pip install ipycanvas
And the installation was apparently successful.
However, even running a minimal instance of ipycanvas produces type JSON serializable errors, e.g.,
canvas = Canvas(width=200, height=200)
canvas.stroke_style = 'blue'
canvas.stroke_line(0, 0, 150, 150)
canvas
I cannot figure out why I am getting an error this time. How do I serialize sage rationals?
The solution I found is just converting every sage number to a float. However this is a little bit annoying while typing. Am I missing something?