Unable to import anything from torch._C

I’m getting the most peculiar error since today. Somehow something broke with my pytorch installation on a linux server. When I try to import anything from torch._C (and consequently import torch doesn’t work at all), it stalls and never continues. I’m unable to interupt the import and need to completely kill the process. I’ve completely reinstalled anaconda but to no avail. Does anyone have any idea?

Could you check for multiple installations and delete all of them (using pip and conda)? Rerun the uninstall commands at least twice.
Are you trying to import PyTorch from the build folder accidentally?

Also try getting a backtrace from GDB (instructions here) and share it here.

Thanks for all the suggestions, but the problem resolved itself somehow overnight and everything is working fine again. Since it’s a shared university server maybe someone else had a process open that was interfering somehow?! I have no idea. In case it ever shows up again I’ll continue this thread.

1 Like