I changed the dependency to 3.10.4 (tried 3.10.6 as well), installed python 3.10.4, deactivated and activated ldm environment, but it still uses python 3.9
Since I don't know how to use conda, I had to struggle a bit to learn how to recreate the environment.
Here's the commands that worked me for future reference:
stable-diffusion/src/k-diffusion/k_diffusion/sampling.py
(before)
(after) This issue is tracked in https://github.com/lstein/stable-diffusion/issues/302