pythonシェルでkerasを使いたいです。
pip3 install kerasでインストールは完了したはずで
pip3 list では
Keras 2.3.1
Keras-Applications 1.0.8
Keres-Preprocessing 1.1.0
と表示されます。
しかしいざipython3でpythonシェルに入った後import kerasと入力すると色々表示された後
Using TensorFlow backend. ERROR:root:Internal Python error in the inspect module. Below is the traceback from this internal error. Failed to load the native TensorFlow runtime. Traceback Traceback 略 Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common reasons and solutions. Include the entire stack trace above this error message when asking for help. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 2044, in showtraceback stb = value._render_traceback_() AttributeError: 'ImportError' object has no attribute '_render_traceback_' During handling of the above exception, another exception occurred: 略 Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common reasons and solutions. Include the entire stack trace above this error message when asking for help. --------------------------------------------------------------------------- ImportError Traceback (most recent call last) /usr/local/lib/python3.7/site-packages/tensorflow_core/python/pywrap_tensorflow.py in <module> 57 ---> 58 from tensorflow.python.pywrap_tensorflow_internal import * 59 from tensorflow.python.pywrap_tensorflow_internal import __version__ /usr/local/lib/python3.7/site-packages/tensorflow_core/python/pywrap_tensorflow_internal.py in <module> 27 return _mod ---> 28 _pywrap_tensorflow_internal = swig_import_helper() 29 del swig_import_helper /usr/local/lib/python3.7/site-packages/tensorflow_core/python/pywrap_tensorflow_internal.py in swig_import_helper() 23 try: ---> 24 _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) 25 finally: /usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/imp.py in load_module(name, file, filename, details) 241 else: --> 242 return load_dynamic(name, filename, file) 243 elif type_ == PKG_DIRECTORY: /usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/imp.py in load_dynamic(name, path, file) 341 name=name, loader=loader, origin=path) --> 342 return _load(spec) 343 ImportError: dlopen(/usr/local/lib/python3.7/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so, 6): Symbol not found: _SecKeyCopyExternalRepresentation Referenced from: /usr/local/lib/python3.7/site-packages/tensorflow_core/python/../libtensorflow_framework.2.dylib Expected in: /System/Library/Frameworks/Security.framework/Versions/A/Security in /usr/local/lib/python3.7/site-packages/tensorflow_core/python/../libtensorflow_framework.2.dylib During handling of the above exception, another exception occurred: During handling of the above exception, another exception occurred: AttributeError Traceback (most recent call last) /usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py in showtraceback(self, exc_tuple, filename, tb_offset, exception_only, running_compiled_code) 2043 # in the engines. This should return a list of strings. -> 2044 stb = value._render_traceback_() 2045 except Exception: AttributeError: 'ImportError' object has no attribute '_render_traceback_' During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_code(self, code_obj, result, async_) 3346 if result is not None: 3347 result.error_in_exec = sys.exc_info()[1] -> 3348 self.showtraceback(running_compiled_code=True) 3349 else: 3350 outflag = False /usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py in showtraceback(self, exc_tuple, filename, tb_offset, exception_only, running_compiled_code) 2045 except Exception: 2046 stb = self.InteractiveTB.structured_traceback(etype, -> 2047 value, tb, tb_offset=tb_offset) 2048 2049 self._showtraceback(etype, value, stb) /usr/local/lib/python3.7/site-packages/IPython/core/ultratb.py in structured_traceback(self, etype, value, tb, tb_offset, number_of_lines_of_context) 1413 self.tb = tb 1414 return FormattedTB.structured_traceback( -> 1415 self, etype, value, tb, tb_offset, number_of_lines_of_context) 1416 1417 /usr/local/lib/python3.7/site-packages/IPython/core/ultratb.py in structured_traceback(self, etype, value, tb, tb_offset, number_of_lines_of_context) 1313 # Verbose modes need a full traceback 1314 return VerboseTB.structured_traceback( -> 1315 self, etype, value, tb, tb_offset, number_of_lines_of_context 1316 ) 1317 elif mode == 'Minimal': /usr/local/lib/python3.7/site-packages/IPython/core/ultratb.py in structured_traceback(self, etype, evalue, etb, tb_offset, number_of_lines_of_context) 1181 exception = self.get_parts_of_chained_exception(evalue) 1182 if exception: -> 1183 formatted_exceptions += self.prepare_chained_exception_message(evalue.__cause__) 1184 etype, evalue, etb = exception 1185 else: TypeError: can only concatenate str (not "list") to str
と出ます。
同様にインストールしたtensorflowは正常にimportされるようです。
Pythonは3.7.7を使っています。
試してみるべきことを教えてください。
回答1件
あなたの回答
tips
プレビュー