google / sentencepiece

Unsupervised text tokenizer for Neural Network-based text generation.
Apache License 2.0
10.15k stars 1.17k forks source link

symbol not found in flat namespace '__ZN13sentencepiece4util6StatusD1Ev' #757

Closed emergix closed 2 years ago

emergix commented 2 years ago

I did pip install --no-cache-dir sentencepiece but when I try to import it in Python 3.9, it crashes with : ImportError: dlopen(/Users/olivier/miniforge3/lib/python3.9/site-packages/sentencepiece/_sentencepiece.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '__ZN13sentencepiece4util6StatusD1Ev' It seems to be a known issue, but none of the fix I have tried works

emergix commented 2 years ago

It runs on a macbook pro M1 max

dpicca commented 2 years ago

After having installed the package following the procedure #608, I got the following error

from simpletransformers.t5 import T5Model, T5Args
Traceback (most recent call last): 
File "<stdin>", line 1, in <module>
File "/Users/~/test/lib/python3.9/site-packages/simpletransformers/t5/__init__.py", line 2, in <module>
    from simpletransformers.t5.t5_model import T5Model
File "/Users/~/test/lib/python3.9/site-packages/simpletransformers/t5/t5_model.py", line 20, in <module>
    from transformers.models.t5 import T5Config, T5ForConditionalGeneration, T5Tokenizer
File "/Users/~/test/lib/python3.9/site-packages/transformers/models/__init__.py", line 19, in <module>
    from . import (
File "/Users/~/test/lib/python3.9/site-packages/transformers/models/mt5/__init__.py", line 33, in <module>
    from ..t5.tokenization_t5 import T5Tokenizer
File "/Users/~/test/lib/python3.9/site-packages/transformers/models/t5/tokenization_t5.py", line 24, in <module>
    import sentencepiece as spm
File "/Users/~/test/lib/python3.9/site-packages/sentencepiece/__init__.py", line 13, in <module>
    from . import _sentencepiece
ImportError: dlopen(/Users/~/test/lib/python3.9/site-packages/sentencepiece/_sentencepiece.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '__ZN13sentencepiece4util6StatusD1Ev'

and it doesn't runs on macbook pro M1 max

thanks for your help

stphnthiel commented 2 years ago

Same problem for me, but under Python 3.10

RuntimeError: Failed to import transformers.models.auto because of the following error (look up to see its traceback):
dlopen(~/opt/miniconda3/envs/m1/lib/python3.10/site-packages/sentencepiece/_sentencepiece.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '__ZN13sentencepiece4util6StatusD1Ev'

First gen M1

emergix commented 2 years ago

I tried to find the symbol __ZN13sentencepiece4util6StatusD1Ev in the code, but it does'nt exist as such. It should be a generated symbol.

nishalsach commented 2 years ago

Facing the exact same issue as @stphnthiel when trying to call sentencepiece from the transformers library, using Python 3.8. Tried to reinstall it with the .tar.gz file as recommended here but still getting the same message.

grantmk commented 2 years ago

Same issue here on M1 first gen

taku910 commented 2 years ago

Could you try the latest version. By the way, v0.1.97 provides wheelpackage for mac arm processors.

taku910 commented 2 years ago

I'm going to close this bug in two weeks unless there are updates.