The the error mentioned in the original post basically means that the launcher script tries to pass --local_rank=1 as an argument to your script (i.e., train.py in this case). However, train.py is not configured to accept that argument.
train.py: error: unrecognized arguments: --local_rank=1

To solve this issue, you can add the following to your ArgumentParser.
parser.add_argument("--local_rank", type=int, default=0)