Import transformers fails; installation issue?
Hello,I have installed transformer in a virtual environnement using conda:conda install -c huggingface transformersthen I hadThe following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    filelock-3.13.1            |     pyhd8ed1ab_0          15 KB  conda-forge
    huggingface_hub-0.20.1     |             py_0         321 KB  huggingface
    regex-2023.12.25           |   py39hd1e30aa_0         337 KB  conda-forge
    sacremoses-master          |             py_0         404 KB  huggingface
    safetensors-0.3.3          |           py39_0         1.1 MB  huggingface
    tokenizers-0.13.0.dev0     |           py39_0         4.5 MB  huggingface
    transformers-4.33.3        |             py_0         3.8 MB  huggingface
    ------------------------------------------------------------
                                           Total:        10.4 MB

The following NEW packages will be INSTALLED:

  filelock           conda-forge/noarch::filelock-3.13.1-pyhd8ed1ab_0 None
  huggingface_hub    huggingface/noarch::huggingface_hub-0.20.1-py_0 None
  regex              conda-forge/linux-64::regex-2023.12.25-py39hd1e30aa_0 None
  sacremoses         huggingface/noarch::sacremoses-master-py_0 None
  safetensors        huggingface/linux-64::safetensors-0.3.3-py39_0 None
  tokenizers         huggingface/linux-64::tokenizers-0.13.0.dev0-py39_0 None
  transformers       huggingface/noarch::transformers-4.33.3-py_0 None


Proceed ([y]/n)? yAs I try to check the installation from ipython, i get:$ python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('I love you'))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/transformers/__init__.py", line 26, in <module>
    from . import dependency_versions_check
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/transformers/dependency_versions_check.py", line 16, in <module>
    from .utils.versions import require_version, require_version_core
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/transformers/utils/__init__.py", line 61, in <module>
    from .hub import (
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/transformers/utils/hub.py", line 33, in <module>
    from huggingface_hub import (
ImportError: cannot import name 'create_branch' from 'huggingface_hub' (/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/huggingface_hub/__init__.py)Import of the transformers module fails:In [2]: import transformerswithImportError: cannot import name 'create_branch' from 'huggingface_hub' (/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/huggingface_hub/__init__.py)Then I try to reinstall using pip:$ pip install transformers
Requirement already satisfied: transformers in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (4.33.3)
Requirement already satisfied: filelock in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from transformers) (3.13.1)
Collecting huggingface-hub<1.0,>=0.15.1
  Downloading huggingface_hub-0.20.1-py3-none-any.whl (330 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 330.1/330.1 kB 2.4 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.17 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from transformers) (1.23.3)
Requirement already satisfied: packaging>=20.0 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from transformers) (21.3)
Requirement already satisfied: pyyaml>=5.1 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from transformers) (6.0)
Requirement already satisfied: regex!=2019.12.17 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from transformers) (2023.12.25)
Requirement already satisfied: requests in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from transformers) (2.28.1)
Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from transformers) (0.13.0.dev0)
Requirement already satisfied: safetensors>=0.3.1 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from transformers) (0.3.3)
Requirement already satisfied: tqdm>=4.27 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from transformers) (4.64.1)
Requirement already satisfied: typing-extensions>=3.7.4.3 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from huggingface-hub<1.0,>=0.15.1->transformers) (4.4.0)
Requirement already satisfied: fsspec>=2023.5.0 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from huggingface-hub<1.0,>=0.15.1->transformers) (2023.12.2)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from packaging>=20.0->transformers) (3.0.9)
Requirement already satisfied: certifi>=2017.4.17 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from requests->transformers) (2023.11.17)
Requirement already satisfied: charset-normalizer<3,>=2 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from requests->transformers) (2.1.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from requests->transformers) (1.26.11)
Requirement already satisfied: idna<4,>=2.5 in /mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages (from requests->transformers) (3.4)
Installing collected packages: huggingface-hub
  Attempting uninstall: huggingface-hub
    Found existing installation: huggingface-hub 0.10.1
    Uninstalling huggingface-hub-0.10.1:
      Successfully uninstalled huggingface-hub-0.10.1
Successfully installed huggingface-hub-0.20.1Then retry to check but fails:$ python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('I love you'))"
Traceback (most recent call last):
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1184, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/transformers/pipelines/__init__.py", line 29, in <module>
    from ..models.auto.configuration_auto import AutoConfig
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/transformers/models/__init__.py", line 15, in <module>
    from . import (
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/transformers/models/mt5/__init__.py", line 36, in <module>
    from ..t5.tokenization_t5_fast import T5TokenizerFast
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/transformers/models/t5/tokenization_t5_fast.py", line 24, in <module>
    from ...tokenization_utils_fast import PreTrainedTokenizerFast
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/transformers/tokenization_utils_fast.py", line 25, in <module>
    import tokenizers.pre_tokenizers as pre_tokenizers_fast
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/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 "<string>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1055, in _handle_fromlist
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1174, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "/mnt/stockage/Developp/env_Flash/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1186, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import transformers.pipelines because of the following error (look up to see its traceback):
libssl.so.10: cannot open shared object file: No such file or directoryHow to resolve the issue? Thanks
2024-04-15T02:09:21Z
I witnessed the same problem, and I fixed this by:pip install transformers -U