YouTokenToMe icon indicating copy to clipboard operation
YouTokenToMe copied to clipboard

ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found

Open timotheecour opened this issue 7 months ago • 0 comments

reduced from a more complex example:

conda create -n tmp2 python=3.10
conda activate tmp2
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install youtokentome

then:

python -c 'import youtokentome; import torch' works

python -c 'import torch; import youtokentome'

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/timothee/.conda/envs/tmp1/lib/python3.10/site-packages/youtokentome/__init__.py", line 1, in <module>
    from .youtokentome import BPE
  File "/home/timothee/.conda/envs/tmp1/lib/python3.10/site-packages/youtokentome/youtokentome.py", line 4, in <module>
    import _youtokentome_cython
ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/timothee/.conda/envs/tmp1/lib/python3.10/site-packages/_youtokentome_cython.cpython-310-x86_64-linux-gnu.so)

environment note:

grep -E '^(VERSION|NAME)=' /etc/os-release
NAME="Oracle Linux Server"
VERSION="7.9"

workaround 1

import torch before import youtokentome or to add:

workaround 2

as mentioned in https://github.com/BVLC/caffe/issues/4953#issuecomment-782131028

conda install libgcc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.conda/envs/tmp1/lib

neither workaround is great and shouldn't be needed

timotheecour avatar Dec 05 '23 02:12 timotheecour