前提・実現したいこと

Python3.7 では tensorflow が使用できない(?)エラーで詰まったため、 Python3.5 に変更したいと思い、以下のことを行うとエラーが表示されてしまいます。

エラーの原因がよくわからないため、考えられる原因を教えていただけないでしょうか?

  1. pyenv で Python3.5 のインストール
  2. pyenv global 3.5.0
  3. pip3 install tensorflow
  4. python3
    import tensorflow

発生している問題・エラーメッセージ

Traceback (most recent call last):
  File "/Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/Users/torulab/.pyenv/versions/3.5.0/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 "/Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: dlopen(/Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): Symbol not found: _SecKeyCopyExternalRepresentation
  Referenced from: /Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/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/torulab/.pyenv/versions/3.5.0/lib/python3.5/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/torulab/.pyenv/versions/3.5.0/lib/python3.5/site-packages/tensorflow/__init__.py", line 22, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/Users/torulab/.pyenv/versions/3.5.0/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 "/Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: dlopen(/Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): Symbol not found: _SecKeyCopyExternalRepresentation
  Referenced from: /Users/torulab/.pyenv/versions/3.5.0/lib/python3.5/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/torulab/.pyenv/versions/3.5.0/lib/python3.5/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.

補足情報 (OS, ツールのバージョンなど)

現状のバージョンなどは以下の通りです。

  • PC:
    mac os

  • $python3 --version:
    Python 3.5.0

  • $pip3 -V:

pip 18.0 from /Users/ユーザ名/.pyenv/versions/3.5.0/lib/python3.5/site-packages/pip-18.0-py3.5.egg/pip (python 3.5)
  • $ pyenv versions:
  system
* 3.5.0 (set by /Users/ユーザ名/.pyenv/version)
  3.6.0
  3.6.2