Usually you would get this error message if you are trying to import custom extensions before importing PyTorch, which doesn’t seem to be the case here.
I also assume that you don’t have any files, which could cause conflicts, in the current working directory.
In that case, could you create a new virtual environment, install PyTorch there, and test it again?