1.代码报错环境:

Windows 10 + Python 3.7

2.整体代码:

        ImportError: Could not find the DLL(s) 'msvcp140_1.dll'. TensorFlow requires that these DLLs be installed in a directory that is named in your %PATH% environment variable. You may install these DLLs by downloading "Microsoft C++ Redistributable for Visual Studio 2015, 2017 and 2019" for your platform from this URL: https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads

3.报错原因:

msvcp140_1.dll 配置文件缺失

4.解决方法:

到网站https://support.microsoft.com/zh-cn/help/2977003/the-latest-supported-visual-c-downloads下载相应计算机文件,点击安装即可:

安装完成后,如图

说是要重启计算机,但是不重启也行,再次运行代码不报错了。

转载于:https://blog.csdn.net/qq_36853469/article/details/105864905

posted on 2020-10-24 22:57  swxj  阅读(3448)  评论(0编辑  收藏  举报