I had this error using python 3.10.16 and pandas 2.0.3, I solved it by just upgrading pandas to latest version