Environment errors need better actionable error reporting
Author: cvanlabe
Pull request: no

## Environment info
- `transformers` version: 4.12.3
- Platform: Linux-5.4.0-66-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- PyTorch version (GPU?): 1.10.0+cu113 (True)  (also applicable to CPU version)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: yes but not required (see below)
- Using distributed or parallel set-up in script?: no

### Who can help
@LysandreJik 
@thomwolf 

Models:
- BERT: @LysandreJik
-- BertForSequenceClassification: @thomwolf 

The problem arises when using:
* [ ] the official example scripts: No.. example scripts protect against human stupidity :-)
* [x] my own modified scripts: 

I was converting a script from TF to Torch. The top of the script sets the following OS Environment variables to be able and load the correct GPU:

```python
import os
os.environ["LD_LIBRARY_PATH"]= f"/usr/local/cuda/extras/CUPTI/lib64"
os.environ['USE_TF'] = 'YES'
os.environ["CUDA_VISIBLE_DEVICES"]="6,7"
```

The only thing the script does besides these environmental variables is this:
```python
import torch
from transformers import BertForSequenceClassification

model_name = "bert-base-uncased"
model = BertForSequenceClassification.from_pretrained(model_name, num_labels=20).to("cuda:0")
```
Executing it gives a frustrating error message:

```python
None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
Traceback (most recent call last):
  File "test_mini.py", line 13, in <module>
    model = BertForSequenceClassification.from_pretrained(model_name, num_labels=20).to("cuda:0")
  File "/home/cvanlabe/venv/lib/python3.8/site-packages/transformers/utils/dummy_pt_objects.py", line 667, in from_pretrained
    requires_backends(cls, ["torch"])
  File "/home/cvanlabe/venv/lib/python3.8/site-packages/transformers/file_utils.py", line 683, in requires_backends
    raise ImportError("".join([BACKENDS_MAPPING[backend][1].format(name) for backend in backends]))
ImportError:
BertForSequenceClassification requires the PyTorch library but it was not found in your environment. Checkout the instructions on the
installation page: https://pytorch.org/get-started/locally/ and follow the ones that match your environment.
```

It only took me over an hour to spot the environment variable `USE_TF='YES'`, a leftover from the earlier tensorflow code.

## To reproduce

Steps to reproduce the behavior:

1. Properly install torch and transformers using the installation instructions
```
- https://pytorch.org/get-started/locally/#start-locally
- https://huggingface.co/transformers/installation.html#installation-with-pip
```
2. Set environment variable `USE_TF='YES'`
3. import torch
4. import BertForSequenceClassification from transformers
5. Try and use BertForSequenceClassification.from_pretrained(model_name, num_labels=20).to("cpu")


## Expected behavior
The error message is telling the user the PyTorch library is not found in the environment, but it actually is. There are a lot of similar errors when googling these types of errors, and almost never was the issue a simple virtual environment or installation problem.

I raised this issue to track a research activity on how to make these error messages more accurate, and more actionable. Yes, it is completely stupid to put USE_TF when you want to use Torch. Nevertheless, if we see how many ["requires the .... library but it was not found in your environment"](https://www.google.com/search?q=%22requires+the%22+%22but+it+was+not+found+in+your+environment%22&client=firefox-b-d&ei=OZOGYdSXIMWXkwWn9p7QAQ&start=10&sa=N&ved=2ahUKEwiUmOKf-4P0AhXFy6QKHSe7BxoQ8NMDegQIARA-&biw=1920&bih=890&dpr=1) there are out there, I think it deserves a look to help the community out there.

Thanks for the great work you guys are doing, and for enabling the community to do fantastic things!!

Comments:
Hey @cvanlabe! There are a lot of errors raised in the library and we definitely aim to have the clearest, more explicit errors that we can raise.
However, it's often complex to see all possible use-cases where one such error might arise, so these bug reports help out a lot! Would you be down to open a PR and update the error raised? That would be very helpful. 

Thank you for the clean issue report! 

I could give it a shot but it won't be before the new year. Currently kneedeep in a project that needs finishing by end of December.

Will need to make myself more familiar with the source code and for this particular use-case how environment variables play a role. Sounds like an interesting future project! :)

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.

add the statement to you pyinstaller shell :
--copy-metadata torch