ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found

8,340

You need install a version of gcc with supports for CXXABI_1.3.8.

First take a look at your current version, run:

gcc -v

Find c++ standard library in your machine, run:

sudo find / -name 'libstdc++.so.6'

Take a look inside your library, run:

strings /lib64/libstdc++.so.6 | grep '^CXXABI_'

Follow below instructions to compile new version of gcc:

# Install dependencies
sudo yum check-update
sudo yum -y install wget make gcc-c++

# Download gcc new version
wget -O - 'https://ftpmirror.gnu.org/gcc/gcc-7.3.0/gcc-7.3.0.tar.xz' | tar -xJ

# This helps if you are behind a proxy
sed -i 's/ftp:/https:/' ./gcc-7.3.0/contrib/download_prerequisites

# Finally compile gcc 
( cd gcc-7.3.0 && ./contrib/download_prerequisites && mkdir build && cd build && ../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib && make -j 8 && sudo make install ) && rm -fR gcc-7.3.0

# Unlink current version
sudo unlink /usr/lib64/libstdc++.so.6

# Copy new version
sudo cp /usr/local/lib64/libstdc++.so.6 /usr/lib64
Share:
8,340
Tushar Sinha
Author by

Tushar Sinha

Updated on September 18, 2022

Comments

  • Tushar Sinha
    Tushar Sinha over 1 year

    I'm trying to run a deep learning model on a university cluster. When I write the command to run the model, I receive this error.

    15CS10019@cpusrv-gpu-112:~/Tushar/Rod-keras_yolo2-master$ python3 train.py -c config.json
    Using TensorFlow backend.
    Traceback (most recent call last):
      File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
        _pywrap_tensorflow_internal = swig_import_helper()
      File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
        _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
      File "/usr/local/lib/python3.7/imp.py", line 242, in load_module
        return load_dynamic(name, filename, file)
      File "/usr/local/lib/python3.7/imp.py", line 342, in load_dynamic
        return _load(spec)
    ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "train.py", line 3, in <module>
        from keras_yolov2.preprocessing import parse_annotation_xml, parse_annotation_csv
      File "/home/bt3/15CS10019/Tushar/Rod-keras_yolo2-master/keras_yolov2/preprocessing.py", line 1, in <module>
        from .utils import BoundBox, bbox_iou
      File "/home/bt3/15CS10019/Tushar/Rod-keras_yolo2-master/keras_yolov2/utils.py", line 1, in <module>
        from .backend import (TinyYoloFeature, FullYoloFeature, MobileNetFeature, SqueezeNetFeature, Inception3Feature,
      File "/home/bt3/15CS10019/Tushar/Rod-keras_yolo2-master/keras_yolov2/backend.py", line 1, in <module>
        from keras.models import Model
      File "/usr/local/lib/python3.7/site-packages/keras/__init__.py", line 3, in <module>
        from . import utils
      File "/usr/local/lib/python3.7/site-packages/keras/utils/__init__.py", line 6, in <module>
        from . import conv_utils
      File "/usr/local/lib/python3.7/site-packages/keras/utils/conv_utils.py", line 9, in <module>
        from .. import backend as K
      File "/usr/local/lib/python3.7/site-packages/keras/backend/__init__.py", line 89, in <module>
        from .tensorflow_backend import *
      File "/usr/local/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
        import tensorflow as tf
      File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 24, in <module>
        from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
      File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
        from tensorflow.python import pywrap_tensorflow
      File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
        raise ImportError(msg)
    ImportError: Traceback (most recent call last):
      File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
        _pywrap_tensorflow_internal = swig_import_helper()
      File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
        _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
      File "/usr/local/lib/python3.7/imp.py", line 242, in load_module
        return load_dynamic(name, filename, file)
      File "/usr/local/lib/python3.7/imp.py", line 342, in load_dynamic
        return _load(spec)
    ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)
    
    
    Failed to load the native TensorFlow runtime.
    
    See https://www.tensorflow.org/install/errors
    
    for some common reasons and solutions.  Include the entire stack trace
    above this error message when asking for help.
    

    How should I resolve this error ?

  • Stefano Fiorucci - anakin87
    Stefano Fiorucci - anakin87 about 3 years
    If you encounter this error: Tar (child): lbzip2: Cannot exec: No such file or directory, you should do: yum -y install bzip2