Sagemath kernel keeps disconnecting in jupyter (notebook and lab)

I have installed sage (sagemath) on Fedora 35 and can run without any issues in its terminal. However when I open it in Jupyter (both Jupyter Lab and Jupyter Notebook) the kernel keeps saying connecting until after a while it says disconnected. I think the problem lies somewhere with my Anaconda installation because if I uninstalling it and use Jupyter the kernel immediately connects. I really would like to use Conda but I don’t know how to fix this. I have looked online and saw people have similar problems but can’t quite manage to work out how they fixed it.