ImportError: Using the `Trainer` with `PyTorch` requires `accelerate>=0.20.1`: Please run `pip install transformers[torch]` or `pip install accelerate -U`
### System Info

I'm running the example code from 
https://huggingface.co/docs/transformers/training

on a Colab

and it's failing with 
[/usr/local/lib/python3.10/dist-packages/transformers/training_args.py](https://localhost:8080/#) in _setup_devices(self)
   1670         if not is_sagemaker_mp_enabled():
   1671             if not is_accelerate_available(min_version="0.20.1"):
-> 1672                 raise ImportError(
   1673                     "Using the `Trainer` with `PyTorch` requires `accelerate>=0.20.1`: Please run `pip install transformers[torch]` or `pip install accelerate -U`"
   1674                 )

ImportError: Using the `Trainer` with `PyTorch` requires `accelerate>=0.20.1`: Please run `pip install transformers[torch]` or `pip install accelerate -U`


However, it still gives the error even after I pip install the recommended libraries.

Also, pip freeze shows that accelerate is accelerate==0.20.3 which should satisfy the requirement of `accelerate>=0.20.1` - so I'm not sure why the Trainer is throwing the error.

Thanks for taking a look @sgugger 

### Who can help?

@sgugger 

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Expected behavior

To run training
You need to restart your colab environment after updating the library.<|||||>thanks @sgugger for the quick fix! I was having the same issue as mentioned by @cssndrx . <|||||>Thank you @sgugger, that was the issue! <|||||>Thanks, I was having the same issue!
<|||||>restart virtalenv slove my same issue,thanks<|||||>wow! Thanks alot @sgugger<|||||>Restarting the notebook and the kernel resolve it also for me<|||||>> You need to restart your colab environment after updating the library.

Thank you.