Installing Tensorflow 1.10 on El Capitan 10.11.6

2020-06-09 17:48发布

I am trying to install tensorflow 1.10 on my old mac, but I run into the same problem every time. As soon as I start the python shell and I do get the error below.

I did try to install it in a virtualenv first, after that, I tried to install it just using pip and got the same error. Also when I tried to install it with conda, the same issue again. I googled and looked that up here, but couldn't solve it yet, maybe due to my noobish acting. I did uninstall anaconda and pip already and tried again, but I always run into the same error.

I do have CUDA installed, although I tried to install tensorflow with and without GPU.

The error results in: Failed to load the native TensorFlow runtime.

I hope someone is able to help, as I would really like to learn this.

(tensorflow) abc:~ me$ python

import tensorflow as tf

Traceback (most recent call last):
  File "/Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/Users/me/tensorflow/lib/python3.6/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 "/Users/me/tensorflow/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/Users/me/tensorflow/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: dlopen(/Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): Symbol not found: _SecKeyCopyExternalRepresentation
  Referenced from: /Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so (which was built for Mac OS X 10.12)
  Expected in: /System/Library/Frameworks/Security.framework/Versions/A/Security
 in /Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so

During handling of the above exception, another exception occurred:

>Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/__init__.py", line 22, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/Users/me/tensorflow/lib/python3.6/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 "/Users/me/tensorflow/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/Users/me/tensorflow/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: dlopen(/Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): Symbol not found: _SecKeyCopyExternalRepresentation
  Referenced from: /Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so (which was built for Mac OS X 10.12)
  Expected in: /System/Library/Frameworks/Security.framework/Versions/A/Security
 in /Users/me/tensorflow/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so

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.

2条回答
孤傲高冷的网名
2楼-- · 2020-06-09 18:01

It seems to be a version conflict. I can succesfully run Tensorflow 1.9.

查看更多
放我归山
3楼-- · 2020-06-09 18:12

I think there is something wrong with TensorFlow 1.10 and OS X El Capitan (10.11.6)!
Just install 1.9.0 instead of 1.10 with the pip command:

pip3 install tensorflow==1.9.0

or its GPU version:

pip3 install tensorflow-gpu==1.9.0
查看更多
登录 后发表回答