我正在尝试在我的 mac air 上安装 tensorflow(规格:OSX 10.8.4、4GB RAM)。虽然 tensorflow 安装干净,就像在 tensorflow.org 页面上一样,并且我能够执行 $ source bin/activate 以获得 tensorflow 提示,但我无法在 python 中导入包。这就是我得到的:
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 4, in <module>
from tensorflow.python import *
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 22, in <module>
from tensorflow.python.client.client_lib import *
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/client/client_lib.py", line 35, in <module>
from tensorflow.python.client.session import InteractiveSession
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 11, in <module>
from tensorflow.python import pywrap_tensorflow as tf_session
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so, 2): Symbol not found: ___sincos_stret
Referenced from: /usr/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so
Expected in: /usr/lib/libSystem.B.dylib
in /usr/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so
我查看了有关 tensorflow 的常见问题部分,并搜索了上面的 ImportError,但到目前为止还没有运气。我想知道这是否是'import tensorflow' 之后的 Error in python中所引用的 protobuf 问题 :TypeError: __init__() got an unexpected keyword argument 'syntax' 。提前致谢。