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