Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.
This repository was archived by the owner on Apr 23, 2024. It is now read-only.

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

@timotheecour

Description

@timotheecour

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 BVLC/caffe#4953 (comment)

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

neither workaround is great and shouldn't be needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions