I was using python=3.8. Amongs the errors there was a warning that the python version was deprecated. I upgraded to python=3.9 and it started working.
python=3.8
python=3.9
For conda/miniconda:
conda create -n yt python=3.9