You should be able to use it in the Desktop version, too. See here. If some of the offered shortcuts don’t work, a workaround is suggested that lets you alter settings for it.
The code you provided is not a minimal, reproducible example so I still cannot try. See Getting good answers to your questions . You can easily test what others that don’t work on the same code as you will face by going here and pressing ‘launch binder’ to get a generic Jupyter session in your browser. I assume I’d need to run %pip install sagemath-standard
but beyond that I don’t know Sagemath as well as your code assumes.