Not sure about the error.
But I guess this error is not related to Pytorch.
Try to run this simple example
https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html 2
if still got an error in the above example. then there might be an error in installation.
Else the error is related to something else.