AttributeError while importing torch

I tried to install PyTorch using Anaconda on Mac with the following command:

conda install pytorch torchvision -c soumith

The installation seemed successful. However, after I ran python and did:

import torch

The following error occurred:

04 AM

What was missing? I tried reinstalling several times but that didn’t help.



This may help. Also do a clean installation by removing previous pytorch libraries that may remain in the system.

Thank you! I’ve actually seen that thread. However, the command I had previously used to install the packages was exactly the same as suggested in the answer to that question:

conda install pytorch torchvision -c soumith

So I wonder what was still missing.

Also, to remove the libraries, is it enough to call:

conda uninstall pytorch torchvision -c soumith

? If so, I’ve uninstalled and reinstalled PyTorch several times, but it still didn’t work.

Any further suggestions?