Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to import tensorflow after installation- DLL load failed: The specified module could not be found error comes up #36377

Closed
rajeshr157 opened this issue Jan 31, 2020 · 2 comments
Assignees
Labels
subtype:windows Windows Build/Installation Issues TF 2.0 Issues relating to TensorFlow 2.0 type:build/install Build and install issues

Comments

@rajeshr157
Copy link

Please go to Stack Overflow for help and support:

https://stackoverflow.com/questions/tagged/tensorflow

If you open a GitHub issue, here is our policy:

  1. It must be a bug, a feature request, or a significant problem with documentation (for small docs fixes please send a PR instead).
  2. The form below must be filled out.
  3. It shouldn't be a TensorBoard issue. Those go here.

Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.


System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow installed from (source or binary):
  • TensorFlow version (use command below):
  • Python version:
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:
  • Exact command to reproduce:

You can collect some of this information using our environment capture script:

https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh

You can obtain the TensorFlow version with:

python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"

Describe the problem

Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.

Source code / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.

@rajeshr157
Copy link
Author

import tensorflow
Traceback (most recent call last):

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\imp.py", line 342, in load_dynamic
return _load(spec)

ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "", line 1, in
import tensorflow

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_init_.py", line 101, in
from tensorflow_core import *

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core_init_.py", line 40, in
from tensorflow.python.tools import module_util as _module_util

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_init_.py", line 50, in getattr
module = self._load()

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_init_.py", line 44, in _load
module = _importlib.import_module(self.name)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)

ImportError: Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

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.

Error in callback <bound method AutoreloadMagics.post_execute_hook of <autoreload.AutoreloadMagics object at 0x000001E4A200A588>> (for post_execute):
Traceback (most recent call last):

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\imp.py", line 342, in load_dynamic
return _load(spec)

ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\IPython\extensions\autoreload.py", line 538, in post_execute_hook
_, pymtime = self._reloader.filename_and_mtime(sys.modules[modname])

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\IPython\extensions\autoreload.py", line 184, in filename_and_mtime
if not hasattr(module, 'file') or module.file is None:

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_init_.py", line 50, in getattr
module = self._load()

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_init_.py", line 44, in _load
module = _importlib.import_module(self.name)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)

File "", line 1006, in _gcd_import

File "", line 983, in _find_and_load

File "", line 953, in _find_and_load_unlocked

File "", line 219, in _call_with_frames_removed

File "", line 1006, in _gcd_import

File "", line 983, in _find_and_load

File "", line 967, in _find_and_load_unlocked

File "", line 677, in _load_unlocked

File "", line 728, in exec_module

File "", line 219, in _call_with_frames_removed

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core_init_.py", line 42, in
from . _api.v2 import audio

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core_api\v2\audio_init_.py", line 10, in
from tensorflow.python.ops.gen_audio_ops import decode_wav

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\ops\gen_audio_ops.py", line 9, in
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_init_.py", line 50, in getattr
module = self._load()

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_init_.py", line 44, in _load
module = _importlib.import_module(self.name)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)

ImportError: Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

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.

import tensorflow as tf
Error in callback <bound method AutoreloadMagics.post_execute_hook of <autoreload.AutoreloadMagics object at 0x000001E4A200A588>> (for post_execute):
Traceback (most recent call last):

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\imp.py", line 342, in load_dynamic
return _load(spec)

ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\IPython\extensions\autoreload.py", line 538, in post_execute_hook
_, pymtime = self._reloader.filename_and_mtime(sys.modules[modname])

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\IPython\extensions\autoreload.py", line 184, in filename_and_mtime
if not hasattr(module, 'file') or module.file is None:

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_init_.py", line 50, in getattr
module = self._load()

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_init_.py", line 44, in _load
module = _importlib.import_module(self.name)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)

File "", line 1006, in _gcd_import

File "", line 983, in _find_and_load

File "", line 953, in _find_and_load_unlocked

File "", line 219, in _call_with_frames_removed

File "", line 1006, in _gcd_import

File "", line 983, in _find_and_load

File "", line 967, in _find_and_load_unlocked

File "", line 677, in _load_unlocked

File "", line 728, in exec_module

File "", line 219, in _call_with_frames_removed

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core_init_.py", line 42, in
from . _api.v2 import audio

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core_api\v2\audio_init_.py", line 10, in
from tensorflow.python.ops.gen_audio_ops import decode_wav

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\ops\gen_audio_ops.py", line 9, in
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_init_.py", line 50, in getattr
module = self._load()

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_init_.py", line 44, in _load
module = _importlib.import_module(self.name)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow

File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)

ImportError: Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\ProgramData\Anaconda3\envs\py3-TF2.0\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

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.

@mihaimaruseac
Copy link
Collaborator

You haven't done any work in this issue: haven't filled in the template, haven't formatted your error message and, most egregiously, haven't checked for duplicates.

Closing as duplicate.

#36167 (comment)

#36167 #36151 #36138 #36054 #36045 #36020 #36003 #35988 #35903 #35880 #35865 #35805 #35789 #35773 #35772 #35767 #35766 #35749 #35721 #35618 #35204

@av8ramit av8ramit closed this as completed Feb 2, 2020
@amahendrakar amahendrakar added subtype:windows Windows Build/Installation Issues TF 2.0 Issues relating to TensorFlow 2.0 type:build/install Build and install issues labels Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subtype:windows Windows Build/Installation Issues TF 2.0 Issues relating to TensorFlow 2.0 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

4 participants