TensorFlow "ImportError: DLL load failed: Specified module not found" error

Asked 1 years ago, Updated 1 years ago, 101 views

To study tensorflow in Win10, you installed python3.6, cuDNN (v7.3.0), CUDA Toolkit (v10.0), and tensorflow-gpu as pip3. However, when I ran the example file, the following error occurred. I also searched for the error on Google, but I am asking you because it is not resolved clearly.

Traceback (most recent call last):
  File "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\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 "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module was not found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".\01 - Basic.py", line 2, in <module>
    import tensorflow as tf
  File "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 22, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\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 "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\gjwng\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module was not found.


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

python3.6 tensorflow

2022-09-22 19:47

1 Answers

In fact, Python is not an easy language and environment, unlike the propaganda of many websites.

Many of Python's modules are c, so basically you have to know how to handle c, and you have to know how to use the resulting so, dll, etc.

If you look at the error message, it is as follows.

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

The meaning of this word is whether there was a library dll made of c. Or it's a message that you can't In other words, find the necessary dll and put it in the system path.

In addition, when installing modules from Python to pip, the expansion modules are compiled and installed. At this time, Windows does not have a built-in compiler, so an environment such as visual c or mingw or cygwin is required.

However, if you don't know c and you don't want to be stressed by the expansion module, that is, if you want to simply handle Python, I recommend the Linux environment.


2022-09-22 19:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.