我在我的Ubuntu 14.10安装Tensorflow的过程。我以前安装numpy的,SciPy的,sklearn也IPython的笔记本。我跟着在Tensorflow.org官方文档(pip installation)我tensorflow安装目录的.The位置/usr/local/lib/python2.7/dist-packages。我在我的Ubuntu终端中执行import tensorflow as ts
时出现以下错误。Tensorflow(仅限CPU)安装错误| Ubuntu 14.10 | numpy的1.8.2
>>> import tensorflow as tf
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 24, in <module>
from tensorflow.python import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 60, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
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
Error importing tensorflow. Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter from there.
根据错误,它必须与numpy。我试图升级numpy的使用命令sudo pip install --upgrade numpy
但是这似乎并没有升级我现有的numpy的版本和问题仍然存在。
解决这个问题有什么建议?
这是堆栈溢出中类似类型的问题的答案,我通过其他方法解决了这个问题。 – CoolCK