前提・実現したいこと
tensorflowを導入
conda経由でtensorflowをインストールしましたが、
インポート時にエラーが発生してしまいます。
発生している問題・エラーメッセージ
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
Traceback (most recent call last):
File "C:\Users\yacoo\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3326, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-20-64156d691fe5>", line 1, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\yacoo\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2040, in showtraceback
stb = value.render_traceback()
AttributeError: 'ModuleNotFoundError' object has no attribute 'render_traceback'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\yacoo\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 1101, in get_records
return fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "C:\Users\yacoo\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 319, in wrapped
return f(*args, **kwargs)
File "C:\Users\yacoo\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 353, in fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "C:\Users\yacoo\Anaconda3\lib\inspect.py", line 1502, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "C:\Users\yacoo\Anaconda3\lib\inspect.py", line 1460, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "C:\Users\yacoo\Anaconda3\lib\inspect.py", line 696, in getsourcefile
if getattr(getmodule(object, filename), 'loader', None) is not None:
File "C:\Users\yacoo\Anaconda3\lib\inspect.py", line 733, in getmodule
if ismodule(module) and hasattr(module, 'file'):
File "C:\Users\yacoo\Anaconda3\lib\site-packages\tensorflow_init.py", line 50, in getattr
File "C:\Users\yacoo\Anaconda3\lib\site-packages\tensorflow_init.py", line 44, in load
File "C:\Users\yacoo\Anaconda3\lib\importlib_init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tensorflow_core'
該当のソースコード
Python
1import tensorflow as tf
試したこと
pip経由、conda経由でそれぞれインストール(別の仮想環境にてインストール)
インストール自体は問題なく完了します。
補足情報(FW/ツールのバージョンなど)
tensorflow-2.0.0.dataのパスは
C:\Users\yacoo\Anaconda3\Lib\site-packages
です。
あなたの回答
tips
プレビュー