If you just run the following without any other code, does it fail?
import torch.distributed as dist

# on rank 0
dist.init_process_group(
    backend = "gloo",
    init_method = 'tcp://192.168.0.1:29500',
    rank = 0,
    world_size = 2
)

# on rank 1
dist.init_process_group(
    backend = "gloo",
    init_method = 'tcp://192.168.0.1:29500',
    rank = 1,
    world_size = 2
)