TensorFlow is often a version or two behind in supporting the latest Python versions. As of now, TensorFlow 2.18 supports Python 3.11. I would suggest downgrading python to 3.11.