简体   繁体   中英

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

I've read multiple posts regarding this problem however no luck fixing it.

I am using tensorflow-cpu version 2.3.1, Python 3.7.3. I have downloaded using pip. I keep on getting ImportError and not sure what to do from here, most post talks about tensorflow-gpu version.

Here is my full Traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\haneu\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\haneu\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 40, in <module>
    from tensorflow.python.eager import context
  File "C:\Users\haneu\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\eager\context.py", line 35, in <module>
    from tensorflow.python import pywrap_tfe
  File "C:\Users\haneu\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\haneu\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\haneu\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: The specified module could not be found.

After uninstalling all Visual Studio previous version and re-installing new one, it got rid of ImportError thanks to Tensorflow Error: ImportError: DLL load failed: The specified module could not be found

However after that I kept on getting ModuleNotFoundError everytime I've got this, uninstalled that module and re-installed it. My guess is that there were versions not compatible with each other. But anyways it had fixed my problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM