I simply initialize my environment:
import torch
 torch.distributed.init_process_group(backend='nccl', init_method='env://')

Then the error comes:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/zhangzy/.local/lib/python3.5/site-packages/torch/distributed/distributed_c10d.py", line 354, in init_process_group
    store, rank, world_size = next(rendezvous(url))
  File "/home/zhangzy/.local/lib/python3.5/site-packages/torch/distributed/rendezvous.py", line 119, in _env_rendezvous_handler
    raise _env_error("RANK")
ValueError: Error initializing torch.distributed using env:// rendezvous: environment variable RANK expected, but not set

What is the cause of this problem please?