在ubuntu中导入tensorflow时出错

时间:2016-11-07 01:06:35

标签: ubuntu import tensorflow

我有ubuntu 14.04;但是当我运行import tensorflow时出现了这个错误:

如果我导入张量流

>>> import tensorflow

RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 23, in <module>
    from tensorflow.python import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: numpy.core.multiarray failed to import

问题是什么以及如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

您需要将numpy版本更新为10(当前版本为9)。