sentencepiece icon indicating copy to clipboard operation
sentencepiece copied to clipboard

symbol not found in flat namespace '__ZN13sentencepiece4util6StatusD1Ev'

Open emergix opened this issue 3 years ago • 7 comments

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 avatar Jun 15 '22 15:06 emergix

It runs on a macbook pro M1 max

emergix avatar Jun 15 '22 15:06 emergix

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

dpicca avatar Jun 26 '22 15:06 dpicca

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

stphnthiel avatar Jul 08 '22 13:07 stphnthiel

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

emergix avatar Jul 13 '22 10:07 emergix

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.

nishalsach avatar Jul 23 '22 02:07 nishalsach

Same issue here on M1 first gen

grantmk avatar Aug 05 '22 19:08 grantmk

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

taku910 avatar Aug 09 '22 01:08 taku910

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

taku910 avatar Oct 05 '22 05:10 taku910