2017-10-16 40 views
0

我通过pip在我的mac上安装了tensorflow,我使用的是anaconda作为我的IDE。 当我运行无法使用tensorflow

import tensoflow

我得到以下错误的命令:

Traceback (most recent call last): 

File "<ipython-input-3-a649b509054f>", line 1, in <module> 
import tensorflow 

File "/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/__init__.py", line 24, in <module> 
from tensorflow.python import * 

File "/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/__init__.py", line 51, in <module> 
from tensorflow.python import pywrap_tensorflow 

File "/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module> 
raise ImportError(msg) 

ImportError: Traceback (most recent call last): 
File "/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module> 
from tensorflow.python.pywrap_tensorflow_internal import * 
File "/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module> 
_pywrap_tensorflow_internal = swig_import_helper() 
File "/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper 
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) 
File "/Applications/anaconda3/lib/python3.5/imp.py", line 243, in load_module 
return load_dynamic(name, filename, file) 
File "/Applications/anaconda3/lib/python3.5/imp.py", line 343, in load_dynamic 
return _load(spec) 
ImportError: dlopen(/Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 10): Library not loaded: @rpath/libcublas.8.0.dylib 
Referenced from: /Applications/anaconda3/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so 
Reason: image not found 


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. 

我也在我的终端跑到pip list检查它是否被正确安装。它列出了我已经安装的所有tensorflow库。 Output of pip list

我使用蟒蛇v1.6.8和Spyder的V3.2.3

+0

你的Mac有NVIDIA GPU吗? – mrry

+0

Macs没有Nvidia GPU,所以我不认为使用GPU版本会对我有好处。所以我应该卸载tensorflow-gpu吗? – Rasik

+0

是的,卸载'tensorflow-gpu'应该可以解决这个问题。 – mrry

回答