我在我的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