Cannot import pipeline after installation
Author: ShushanArakelyan
Pull request: no

## Environment info

- `transformers` version: 4.9.0
- Platform: Linux-4.15.0-151-generic-x86_64-with-glibc2.27
- Python version: 3.9.2
- PyTorch version (GPU?): 1.7.1+cu101 (False)
- Tensorflow version (GPU?): 2.5.0 (False)
- Flax version (CPU?/GPU?/TPU?): 0.3.4 (cpu)
- Jax version: 0.2.17
- JaxLib version: 0.1.69
- Using GPU in script?: no
- Using distributed or parallel set-up in script?: no

### Who can help
@LysandreJik

## Information

The problem arises when using:
* [ ] the official example scripts: (give details below)
I am attempting a fresh installation of transformers library, but after successfully completing the installation with pip, I am not able to run the test script: `python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('we love you'))"` 

Instead, I see the following output:

> /home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/gensim/similarities/__init__.py:15: UserWarning: The gensim.similarities.levenshtein submodule is disabled, because the optional Levenshtein package <https://pypi.org/proje$
> t/python-Levenshtein/> is unavailable. Install Levenhstein (e.g. `pip install python-Levenshtein`) to suppress this warning.                                                                                                                  
>   warnings.warn(msg)                                                                                                                                                                                                                          
> Traceback (most recent call last):                                                                                                                                                                                                            
>   File "<string>", line 1, in <module>                                                                                                                                                                                                        
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/file_utils.py", line 1977, in __getattr__                                                                                                               
>     module = self._get_module(self._class_to_module[name])                                                                                                                                                                                    
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/file_utils.py", line 1986, in _get_module                                                                                                               
>     return importlib.import_module("." + module_name, self.__name__)                                                                                                                                                                          
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/importlib/__init__.py", line 127, in import_module                                                                                                                                 
>     return _bootstrap._gcd_import(name[level:], package, level)                                                                                                                                                                               
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/pipelines/__init__.py", line 25, in <module>                                                                                                            
>     from ..models.auto.configuration_auto import AutoConfig                                                                                                                                                                                   
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/models/__init__.py", line 19, in <module>                                                                                                               
>     from . import (                                                                                                                                                                                                                           
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/models/layoutlm/__init__.py", line 22, in <module>                                                                                                      
>     from .configuration_layoutlm import LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMConfig                                                                                                                                                
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/models/layoutlm/configuration_layoutlm.py", line 19, in <module>                                                                                        
>     from ..bert.configuration_bert import BertConfig                                                                                                                                                                                          
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/models/bert/configuration_bert.py", line 21, in <module>                                                                                                
>     from ...onnx import OnnxConfig                                                                                                                                                                                                            
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/onnx/__init__.py", line 16, in <module>                                                                                                                 
>     from .config import EXTERNAL_DATA_FORMAT_SIZE_LIMIT, OnnxConfig, OnnxConfigWithPast                                                                                                                                                       
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/onnx/config.py", line 18, in <module>                                                                                                                   
>     from transformers import PretrainedConfig, PreTrainedTokenizer, TensorType                                                                                                                                                                
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/file_utils.py", line 1977, in __getattr__                                                                                                               
>     module = self._get_module(self._class_to_module[name])                                                                                                                                                                                    
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/file_utils.py", line 1986, in _get_module                                                                                                               
>     return importlib.import_module("." + module_name, self.__name__)                                                                                                                                                                          
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/importlib/__init__.py", line 127, in import_module                                                                                                                                 
>     return _bootstrap._gcd_import(name[level:], package, level)                                                                                                                                                                               
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/tokenization_utils.py", line 26, in <module>                                                                                                            
>     from .tokenization_utils_base import (                                                                                                                                                                                                    
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 74, in <module>                                                                                                       
>     from tokenizers import AddedToken                                                                                                                                                                                                         
>   File "/home/shushan/tokenization_experiments/tokenizers.py", line 26, in <module>                                                                                                                                                           
>     from transformers import BertTokenizer
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/file_utils.py", line 1978, in __getattr__
>     value = getattr(module, name)
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/file_utils.py", line 1977, in __getattr__
>     module = self._get_module(self._class_to_module[name])
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/file_utils.py", line 1986, in _get_module
>     return importlib.import_module("." + module_name, self.__name__)
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/importlib/__init__.py", line 127, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
>   File "/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformers/models/bert/tokenization_bert.py", line 23, in <module>
>     from ...tokenization_utils import PreTrainedTokenizer, _is_control, _is_punctuation, _is_whitespace
> ImportError: cannot import name 'PreTrainedTokenizer' from partially initialized module 'transformers.tokenization_utils' (most likely due to a circular import) (/home/shushan/.conda/envs/ccg_parser/lib/python3.9/site-packages/transformer
> s/tokenization_utils.py)
> 

I have attempted uninstalling transformers and re-installing them, but I couldn't find any more information as to what is wrong, or how to go about fixing this issue I am seeing. The only suspicious behavior is that your tool for the environment detection above printed that I have torch installed without GPU, while in reality I have an installation of pytorch that works with gpu. Can you help?
Thanks in advance
Shushan

Comments:
Hello! Could you show me the command you used to install `transformers`?  Thank you!

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.

Same issue

```
❯ python transformers.py
Traceback (most recent call last):
  File "transformers.py", line 3, in <module>
    import transformers
  File "/Users/xxxxxx/Desktop/transformers.py", line 4, in <module>
    from transformers import pipeline
ImportError: cannot import name 'pipeline' from partially initialized module 'transformers' (most likely due to a circular import) (/Users/xxxxxx/Desktop/transformers.py)
```

You're trying to import transformers in a file named `transformers.py`, that won't work.

@LysandreJik my script name is transformers.py

The script content is the Quick Tour example https://github.com/huggingface/transformers
```
import requests
from PIL import Image
from transformers import pipeline

# Download an image with cute cats
url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/coco_sample.png"
image_data = requests.get(url, stream=True).raw
image = Image.open(image_data)

# Allocate a pipeline for object detection
object_detector = pipeline('object_detection')
object_detector(image)
```

Yes, please rename your script. If you're doing `import transformers` from inside a script named `transformers.py`, the script will try to import itself.