2017-10-16 82 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

回答