Failed to load the native TensorFlow runtime after following the installation instructions

385 views Asked by At

I'm trying to install SyntaxNet on Ubuntu, I followed the Ubuntu 16.10+ binary installation instruction here. When I ran the last command:

python -c 'import dragnn.python.load_dragnn_cc_impl, syntaxnet.load_parser_ops'

I get this long line of error message below:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/dragnn/python/load_dragnn_cc_impl.py", line 19, in <module>
    import tensorflow as tf
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 51, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/local/lib/python2.7/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so)


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

I checked the common installation problems page but it appears there is no fix for this there yet. Does anyone have a similar problem installing SyntaxNet? I would really appreciate your help.

1

There are 1 answers

1
frankli22586 On

You need to install latest libstdc++6.

  1. check version

    strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX

  2. add repo

    sudo add-apt-repository ppa:ubuntu-toolchain-r/test

  3. install

    sudo apt-get update sudo apt-get dist-upgrade # I used this command, I guess that the following command should also work.

    sudo apt-get install libstdc++6

I followed this: How to fix: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found.