運行TensorFlow代碼報錯ImportError: Could not find the DLL(s) 'msvcp140_1.dll'

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下載相應計算機文件,點擊安裝即可:

安裝完成後,如圖

說是要重啓計算機,但是不重啓也行,再次運行代碼不報錯了。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章