如何解决tensor flow cpu dll not found错误

How to solve tensor flow cpu dll not found error

我已经安装了 tensorflow v2.1.0 以及 python version 3.6.6pip version 20.0.2。当我尝试导入 tensorflow 时出现以下错误。

C:\Users\Dexter>python
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "C:\Users\Dexter\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Dexter\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Dexter\AppData\Local\Programs\Python\Python36\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:\Users\Dexter\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Dexter\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

当我在 google 上搜索时,我总是得到 tensorflow-gpu 解决方案我的系统中没有任何图形卡。下面是我的显示驱动程序的信息。请帮助我解决这个问题。

我有 Visual Studio 2017

的 C++ Redistributable

尝试安装Anaconda 创建一个虚拟环境。它会自动安装你想要的库的所有依赖项!

根据 installation instructions for Windows,Tensorflow 2.1.0 需要 Microsoft Visual C++ Redistributable for Visual Studio 2015、2017 和 2019 - 这就是你(部分)失踪。此外,从 TensorFlow 2.1.0 版本开始,此包中需要 msvcp140_1.dll 文件(较旧的可再发行包可能不提供)。

这就是您收到错误的原因。安装 these instructions. In essence, grab the 2015, 2017 and 2019 Redistributable, all in single package, available from here.

之后缺少的包