ModuleNotFoundError: No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package

1.module ‘torch.distributed’ has no attribute ‘init_process_group’
I am trying to source compile pytorch on macos, I have installed libuv and pkg-config but I am getting the above 2 errors, is there a solution?