In my case, there are two numpy installations in the same environment. One 1.24 and one 2.2.6. To fix this, do pip uninstall numpy multiple times until there is no numpy, and then install your desired numpy version.
pip uninstall numpy