按照安装说明

时间:2017-12-05 18:32:06

标签: python tensorflow nlp syntaxnet

我正在尝试在Ubuntu上安装SyntaxNet,我遵循Ubuntu 16.10+二进制安装指令here。当我运行最后一个命令时:

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

我在下面得到了这一长串错误消息:

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.

我检查了常见的安装问题页面,但似乎还没有修复此问题。有没有人在安装SyntaxNet时遇到类似的问题?我非常感谢你的帮助。

1 个答案:

答案 0 :(得分:0)

您需要安装最新的libstdc ++ 6。

  1. 检查版本
      

    字符串/usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX

  2. 添加回购
      

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

  3. 安装

      

    sudo apt-get update   sudo apt-get dist-upgrade#我使用了这个命令,我猜以下命令也应该有效。

         

    sudo apt-get install libstdc ++ 6

  4. 我遵循了这个:How to fix: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found