Error when trying to install transformers with Conda
Author: sophiamaedler
Pull request: no

### System Info

- Platform: Linux-5.14.21-150400.24.41-default-x86_64-with-glibc2.10
- Python version: 3.8.17
- Huggingface_hub version: 0.15.1
- PyTorch version (GPU?): 2.0.1 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed

### Who can help?

_No response_

### 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)

### Reproduction

```
# Install PyTorch According to Documentation for System

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

#install transformers according to documentation
conda install -c huggingface transformers
```

Error message when trying to import transformers: 
```
Python 3.8.17 | packaged by conda-forge | (default, Jun 16 2023, 07:06:00) 
[GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from transformers import AutoImageProcessor, ConvNextModel, ConvNextConfig, ViTFeatureExtractor
Traceback (most recent call last):
  File "/fs/home/maedler/.local/miniconda3/envs/ConvNext_pip/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 1110, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "/fs/home/maedler/.local/miniconda3/envs/ConvNext_pip/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/fs/home/maedler/.local/miniconda3/envs/ConvNext_pip/lib/python3.8/site-packages/transformers/models/__init__.py", line 19, in <module>
    from . import (
  File "/fs/home/maedler/.local/miniconda3/envs/ConvNext_pip/lib/python3.8/site-packages/transformers/models/mt5/__init__.py", line 40, in <module>
    from ..t5.tokenization_t5_fast import T5TokenizerFast
  File "/fs/home/maedler/.local/miniconda3/envs/ConvNext_pip/lib/python3.8/site-packages/transformers/models/t5/tokenization_t5_fast.py", line 24, in <module>
    from ...tokenization_utils_fast import PreTrainedTokenizerFast
  File "/fs/home/maedler/.local/miniconda3/envs/ConvNext_pip/lib/python3.8/site-packages/transformers/tokenization_utils_fast.py", line 25, in <module>
    import tokenizers.pre_tokenizers as pre_tokenizers_fast
  File "/fs/home/maedler/.local/miniconda3/envs/ConvNext_pip/lib/python3.8/site-packages/tokenizers/__init__.py", line 79, in <module>
    from .tokenizers import (
ImportError: libssl.so.10: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1039, in _handle_fromlist
  File "/fs/home/maedler/.local/miniconda3/envs/ConvNext_pip/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 1100, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "/fs/home/maedler/.local/miniconda3/envs/ConvNext_pip/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 1112, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import transformers.models.auto because of the following error (look up to see its traceback):
libssl.so.10: cannot open shared object file: No such file or directory
```

If I first install tokenizers from Conda-forge and then afterwards install transformers with --no-update-deps I can use the package:

```
# Install PyTorch According to Documentation for System

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

#install transformers with workaround
conda install tokenizers -c conda-forge
Conda install -c huggingface 'transformers==4.26.0' --no-update-deps
```

This results in: 

```
Python 3.8.17 | packaged by conda-forge | (default, Jun 16 2023, 07:06:00) 
[GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from transformers import AutoImageProcessor, ConvNextModel, ConvNextConfig, ViTFeatureExtractor
>>> 
```



### Expected behavior

A working installation of transformer with the default tokenizers installation from Conda.

Comments:
cc @LysandreJik 

Hey, that seems to be a problem with a missing SSL package.

Could you check if following these instructions fixes your issue? https://github.com/huggingface/transformers/issues/21805#issuecomment-1478161530

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/main/CONTRIBUTING.md) are likely to be ignored.

Just ran into this as well. I think this is still a bug?

One question is why not default to `conda-forge::transformers` on the installation guide? Currently it suggests `huggingface::transformers` https://huggingface.co/docs/transformers/installation:

<img width="395" alt="Screenshot 2023-12-29 at 21 42 39" src="https://github.com/huggingface/transformers/assets/7593028/d18b1c0f-a0cc-4d49-9f9e-d3c9214b6321">

but even installing this in a clean conda environment results in this error due to libssl.

(I think the only reason e.g., NVIDIA has a separate channels is because they need to upload binaries rather than source code, and conda-forge heavily discourages this). But since HF is all open-source, why not prioritize https://github.com/conda-forge/transformers-feedstock? Otherwise it will cause separate libraries for all dependencies to be installed which could cause a bunch of linking issues.



Indeed @MilesCranmer, updating that line to recommend installing from conda-forge would be best.

Would you like to open a PR updating it?