Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail to import import transformers.trainer due to libssl.so.10: cannot open shared object file: No such file or directory #18549

Closed
4 tasks
xxiexuezhi opened this issue Aug 9, 2022 · 13 comments
Labels

Comments

@xxiexuezhi
Copy link

xxiexuezhi commented Aug 9, 2022

System Info

Traceback (most recent call last):
File "/home/xxie92/anaconda3/envs/sema/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 1002, in _get_module
return importlib.import_module("." + module_name, self.name)
File "/home/xxie92/anaconda3/envs/sema/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 843, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/xxie92/anaconda3/envs/sema/lib/python3.8/site-packages/transformers/trainer.py", line 66, in
from .data.data_collator import DataCollator, DataCollatorWithPadding, default_data_collator
File "/home/xxie92/anaconda3/envs/sema/lib/python3.8/site-packages/transformers/data/init.py", line 19, in
from .data_collator import (
File "/home/xxie92/anaconda3/envs/sema/lib/python3.8/site-packages/transformers/data/data_collator.py", line 21, in
from ..models.bert import BertTokenizer, BertTokenizerFast
File "/home/xxie92/anaconda3/envs/sema/lib/python3.8/site-packages/transformers/models/init.py", line 19, in
from . import (
File "/home/xxie92/anaconda3/envs/sema/lib/python3.8/site-packages/transformers/models/mt5/init.py", line 40, in
from ..t5.tokenization_t5_fast import T5TokenizerFast
File "/home/xxie92/anaconda3/envs/sema/lib/python3.8/site-packages/transformers/models/t5/tokenization_t5_fast.py", line 23, in
from ...tokenization_utils_fast import PreTrainedTokenizerFast
File "/home/xxie92/anaconda3/envs/sema/lib/python3.8/site-packages/transformers/tokenization_utils_fast.py", line 24, in
import tokenizers.pre_tokenizers as pre_tokenizers_fast
File "/home/xxie92/anaconda3/envs/sema/lib/python3.8/site-packages/tokenizers/init.py", line 79, in
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 "test.py", line 3, in
from transformers import Trainer, TrainingArguments, EvalPrediction
File "", line 1039, in _handle_fromlist
File "/home/xxie92/anaconda3/envs/sema/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 992, in getattr
module = self._get_module(self._class_to_module[name])
File "/home/xxie92/anaconda3/envs/sema/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 1004, in _get_module
raise RuntimeError(
RuntimeError: Failed to import transformers.trainer because of the following error (look up to see its traceback):
libssl.so.10: cannot open shared object file: No such file or directory

Who can help?

No response

Information

  • 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

I installed transformers following the official online website. steps: I create a new env using conda. And install it using conda. it give this error. i also tried from pip to install. the same error appear.

From the error message, it seems tokenizer package may be the problem. But I am not sure how to solve it.

@xxiexuezhi
Copy link
Author

I am not exacly sure how solve it. But bascially I tried all combination from pip and conda and somehow it works.

@Utopiah
Copy link

Utopiah commented Aug 24, 2022

I don't think this should be closed as I'm getting the same error on continuumio/anaconda3 after conda install -c huggingface transformers but pip install transformers did work.

@GeminiLn
Copy link

Got the same error with conda install -c huggingface transfformers. And thank you @Utopiah , the pip works.

@Pranav-Machingal
Copy link

Pranav-Machingal commented Aug 29, 2022

I am getting the following error with pip,
RuntimeError: Failed to import transformers.trainer because of the following error (look up to see its traceback): cannot import name 'BertTokenizerFast' from 'transformers.models.bert' (/home/pranav.mac/anaconda3/lib/python3.9/site-packages/transformers/models/bert/__init__.py)

@Pranav-Machingal
Copy link

I am getting the following error with pip, RuntimeError: Failed to import transformers.trainer because of the following error (look up to see its traceback): cannot import name 'BertTokenizerFast' from 'transformers.models.bert' (/home/pranav.mac/anaconda3/lib/python3.9/site-packages/transformers/models/bert/__init__.py)

I worked when I did pip uninstall tokenizers and pip install transformers

@fufeisi
Copy link

fufeisi commented Nov 10, 2022

Got the same error with conda install -c huggingface transfformers.

@CryptoLordSheogorath
Copy link

I was able to solve this by uninstalling torch

@NRodion
Copy link

NRodion commented May 10, 2023

I am getting the following error with pip, RuntimeError: Failed to import transformers.trainer because of the following error (look up to see its traceback): cannot import name 'BertTokenizerFast' from 'transformers.models.bert' (/home/pranav.mac/anaconda3/lib/python3.9/site-packages/transformers/models/bert/__init__.py)

I worked when I did pip uninstall tokenizers and pip install transformers

Worked for me

@kkkkk001
Copy link

I am getting the following error with pip, RuntimeError: Failed to import transformers.trainer because of the following error (look up to see its traceback): cannot import name 'BertTokenizerFast' from 'transformers.models.bert' (/home/pranav.mac/anaconda3/lib/python3.9/site-packages/transformers/models/bert/__init__.py)

I worked when I did pip uninstall tokenizers and pip install transformers

These two commands worked for me with the error 'libssl.so.10: cannot open shared object file'.

@fhirfly
Copy link

fhirfly commented Aug 13, 2023

Same error here on miniconda/linux(ubunut) when I run conda install. As others have said, the error goes away with : pip uninstall tokenizers and pip install transformers.

@weiwei1206
Copy link

I am getting the following error with pip, RuntimeError: Failed to import transformers.trainer because of the following error (look up to see its traceback): cannot import name 'BertTokenizerFast' from 'transformers.models.bert' (/home/pranav.mac/anaconda3/lib/python3.9/site-packages/transformers/models/bert/__init__.py)

I worked when I did pip uninstall tokenizers and pip install transformers

worked for me

@boolYikes
Copy link

I am getting the following error with pip, RuntimeError: Failed to import transformers.trainer because of the following error (look up to see its traceback): cannot import name 'BertTokenizerFast' from 'transformers.models.bert' (/home/pranav.mac/anaconda3/lib/python3.9/site-packages/transformers/models/bert/__init__.py)

I worked when I did pip uninstall tokenizers and pip install transformers

This solves libssl problem altogether. GREEEAAAAT!

@charchit7
Copy link

using pip installation from here : https://huggingface.co/docs/diffusers/installation
worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests