Reputation: 11
Its repetitively showing this error while importing tensorflow
I am using a separate environment in anaconda with jupyter installed.Can anyone help me solve this error
ImportError Traceback (most recent call last) E:\Anaconda2\Library\envs\tf-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in 63 try: ---> 64 from tensorflow.python._pywrap_tensorflow_internal import * 65 # This try catch logic is because there is no bazel equivalent for py_extension.
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last) in 1 import os ----> 2 import tensorflow as tf 3 import matplotlib.pyplot as plt 4 import numpy as np 5 import pandas as pd
E:\Anaconda2\Library\envs\tf-gpu\lib\site-packages\tensorflow_init_.py in 39 import sys as _sys 40 ---> 41 from tensorflow.python.tools import module_util as _module_util 42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader 43
E:\Anaconda2\Library\envs\tf-gpu\lib\site-packages\tensorflow\python_init_.py in 37 # go/tf-wildcard-import 38 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top ---> 39 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow 40 41 from tensorflow.python.eager import context
E:\Anaconda2\Library\envs\tf-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in 81 for some common reasons and solutions. Include the entire stack trace 82 above this error message when asking for help.""" % traceback.format_exc() ---> 83 raise ImportError(msg) 84 85 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
ImportError: Traceback (most recent call last): File "E:\Anaconda2\Library\envs\tf-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed: The specified module could not be found.
Upvotes: 0
Views: 256
Reputation:
DLL load fail error is because either you have not installed Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 or your CPU does not support AVX2 instructions
There is a workaround either you have to compile Tensorflow from source or use google colaboratory to work. Follow the instructions mentioned here to build Tensorflow from source.
Upvotes: 0