ImportError: cannot import name 'invoke_rpc_builtin' from 'torch.distributed'
Python 3.7.9 (default, Aug 31 2020, 07:22:35)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pytorch_lightning as pl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ericwiener/anaconda3/envs/donkey/lib/python3.7/site-packages/pytorch_lightning/__init__.py", line 61, in <module>
    from pytorch_lightning.callbacks import Callback
  File "/Users/ericwiener/anaconda3/envs/donkey/lib/python3.7/site-packages/pytorch_lightning/callbacks/__init__.py", line 19, in <module>
    from pytorch_lightning.callbacks.model_checkpoint import ModelCheckpoint
  File "/Users/ericwiener/anaconda3/envs/donkey/lib/python3.7/site-packages/pytorch_lightning/callbacks/model_checkpoint.py", line 36, in <module>
    from pytorch_lightning.plugins.rpc_plugin import RPCPlugin
  File "/Users/ericwiener/anaconda3/envs/donkey/lib/python3.7/site-packages/pytorch_lightning/plugins/rpc_plugin.py", line 24, in <module>
    from torch.distributed import rpc
  File "/Users/ericwiener/anaconda3/envs/donkey/lib/python3.7/site-packages/torch/distributed/rpc.py", line 3, in <module>
    from . import invoke_rpc_builtin, invoke_rpc_python_udf, invoke_remote_builtin
ImportError: cannot import name 'invoke_rpc_builtin' from 'torch.distributed' (/Users/ericwiener/anaconda3/envs/donkey/lib/python3.7/site-packages/torch/distributed/__init__.py)
reported on slack
https://pytorch-lightning.slack.com/archives/CRBLFHY79/p1608427484257200
by Eric Wiener
it probably happens when torch<1.7 (due to missing rpc)